0

I am trying to connect with Salesforce using below lib and getting below issue and unable to find how to enable the API as per Error.

https://github.com/developerforce/Force.com-Toolkit-for-PHP

Code:-

<?php 
error_reporting(E_ALL);
ini_set("display_errors", 1);
require_once ('soapclient/SforcePartnerClient.php');
$mySforceConnection = new SforcePartnerClient();



$mySoapClient = $mySforceConnection->createConnection("soapclient/partner.wsdl.xml");

$mylogin = $mySforceConnection->login("[email protected]", "pass#xa9Ur9xMD6qqdRhdmLBuiRev");
var_dump($mylogin);die;

 ?>


Fatal error: Uncaught SoapFault exception: [sf:API_DISABLED_FOR_ORG] API_DISABLED_FOR_ORG: 
API is not enabled for this Organization or Partner in 
/var/www/mssdev/force/soapclient/SforceBaseClient.php:168 Stack trace: 
#0 /var/www/mssdev/force/soapclient/SforceBaseClient.php(168): SoapClient->__call('login', Array) 
#1 /var/www/mssdev/force/soapclient/SforceBaseClient.php(168): SforceSoapClient->login(Array) 
#2 /var/www/mssdev/force/index.php(11): SforceBaseClient->login('xyz@gm...', 'fas#xa9Ur9...')
#3 {main} thrown in /var/www/mssdev/force/soapclient/SforceBaseClient.php on line 168

2 Answers 2

1

You are probably using Salesforce Gorup or Professional edition where the API is not available.

Other scenario (if You have other edition tham mentioned above) that the API is not enabled for Your user. However from the error message the most possible is scenario #1.

Sign up to request clarification or add additional context in comments.

Comments

0

Use the developer account and the issue has solved.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.