You need to sign in to do that
Don't have an account?
coling
API is not enabled for this Organization or Partner - w/clientId set for Professional Edition login
Hi,
In testing my (Partner) app with a Professional Edition account, I am getting an error logging in through the API (using PHP Toolkit 1.0.6)
"API is not enabled for this Organization or Partner"
The following PHP snippet shows that setClientId is called before the login::
$sf_client_id = "[Client Id supplied by Salesforce.com on certification]";
function sf_login($user_id, $wsdl, $username, $password) {
global $sf_connection;
global $sf_client_id;
$loginResult = null;
$errors = "";
if (($username != "") && ($password != "")) {
try {
$sf_connection = new SforcePartnerClient();
$sf_connection->createConnection($wsdl);
$sf_connection->setClientId($sf_client_id);
$loginResult = $sf_connection->login($username, $password);
$location = $sf_connection->getLocation();
$sessionId = $sf_connection->getSessionId();
} catch (Exception $e) {
...
}
...
}
The request sent is:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:partner.soap.sforce.com">
<SOAP-ENV:Body>
<ns1:login>
<ns1:username>[professional edition account username supplied]</ns1:username>
<ns1:password>[professional edition account password supplied]</ns1:password>
</ns1:login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Request header:
POST /services/Soap/u/7.0 HTTP/1.1
Host: www.salesforce.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.0
Accept-Encoding: gzip, deflate
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 317
Response:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>sf:API_DISABLED_FOR_ORG</faultcode>
<faultstring>API_DISABLED_FOR_ORG: API is not enabled for this Organization or Partner</faultstring>
<detail><sf:fault xsi:type="sf:UnexpectedErrorFault"><sf:exceptionCode>API_DISABLED_FOR_ORG</sf:exceptionCode><sf:exceptionMessage>API is not enabled for this Organization or Partner</sf:exceptionMessage></sf:fault></detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Can you help?
Thanks
Colin Goldberg
In testing my (Partner) app with a Professional Edition account, I am getting an error logging in through the API (using PHP Toolkit 1.0.6)
"API is not enabled for this Organization or Partner"
The following PHP snippet shows that setClientId is called before the login::
$sf_client_id = "[Client Id supplied by Salesforce.com on certification]";
function sf_login($user_id, $wsdl, $username, $password) {
global $sf_connection;
global $sf_client_id;
$loginResult = null;
$errors = "";
if (($username != "") && ($password != "")) {
try {
$sf_connection = new SforcePartnerClient();
$sf_connection->createConnection($wsdl);
$sf_connection->setClientId($sf_client_id);
$loginResult = $sf_connection->login($username, $password);
$location = $sf_connection->getLocation();
$sessionId = $sf_connection->getSessionId();
} catch (Exception $e) {
...
}
...
}
The request sent is:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:partner.soap.sforce.com">
<SOAP-ENV:Body>
<ns1:login>
<ns1:username>[professional edition account username supplied]</ns1:username>
<ns1:password>[professional edition account password supplied]</ns1:password>
</ns1:login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Request header:
POST /services/Soap/u/7.0 HTTP/1.1
Host: www.salesforce.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.0
Accept-Encoding: gzip, deflate
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 317
Response:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>sf:API_DISABLED_FOR_ORG</faultcode>
<faultstring>API_DISABLED_FOR_ORG: API is not enabled for this Organization or Partner</faultstring>
<detail><sf:fault xsi:type="sf:UnexpectedErrorFault"><sf:exceptionCode>API_DISABLED_FOR_ORG</sf:exceptionCode><sf:exceptionMessage>API is not enabled for this Organization or Partner</sf:exceptionMessage></sf:fault></detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Can you help?
Thanks
Colin Goldberg
Hopefully one of the PHP guys can tell you what you're doing wrong.