function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
benfaustbenfaust 

Client ID with PHP

We need to include a certified Client ID using PHP. I noticed another thread saying this is not in the API documentation. Someone provided us with the following Java and C code, but could not provide any PHP examples. Anyone know how to do this with PHP?
 
// Use the following in your login method,
// before you make your login call to the service.
// set the call option for client id

Java Example:
String clientID =
"your_clientid_is_case_sensitive";
CallOptions co = new CallOptions();
co.setClient(clientID);

// bind it to the current soap session
binding.setHeader("SforceService", "CallOptions", co);

C# Example:
String clientID = "your_clientid_is_case_sensitive";
CallOptions co = new CallOptions();
co.client = clientID;

binding.CallOptionsValue = co;
Tran ManTran Man

Create your connection then execute:

 $mySforceConnection->setClientId(‘your_clientid_case_is_sensitive’);

substituting with your clientid, of course.
benfaustbenfaust

Super, thanks.

I used the following, but it says API is not enabled for this client/organization.

$client2=new SforcePartnerClient();
$client=$client2->createConnection("partner.wsdl.xml");
$client2->setClientID('our_userid_is_here');

Am I doing something wrong here? I tried the setClientID with $client, but it says the call is not valid, while $client2 returns the following error:

[sf:API_DISABLED_FOR_ORG] API_DISABLED_FOR_ORG: API is not enabled for this Organization or Partner

lettuceheadlettucehead

Please reply to the email that sent you your client id.

Send us your email address so we can contact your.

Thanks.

n10ctn10ct
We're still having issues with the Professional User, and still getting the message "api usage not authorized".

 

The plugging in of the client id was supposed to stop this message and allow the application to be used by both pro and executive level salesforce users.  However, we're at an impass re: the Professional User, which is the whole reason why we went down the path of Certification. 

 

What can be done to resolve?

SuperfellSuperfell
Send me a capture of your SOAP request that includes the clientId (sfell at salesforce.com)
n10ctn10ct
Simon: Ben Faust will be sending this to you in a few seconds.  Thanks.
Tran ManTran Man