2
votes

I am using the REST api to sync data from my wordpress site to salesforce. I am looking to see in a report from where the api calls are originating and i found that i can use the client id in the "CallOptions" header.

My reference: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/headers_calloptions.html

from that page:

Field name
    Sforce-Call-Options

Field values
    client—A string that identifies a client.
    defaultNamespace—A string that identifies a developer ...

My question is, how do i write the headers array (correct syntax) to contain the call options header with only "client" with a value.

i tried 'headers' => array('Sforce-Call-Options' => 'My-Client-Name') But the client id doesn't show in the report. Also, is there maybe something i need to do in the salesforce environment because this is REST? i managed to add this in SOAP (using "setCallOptions" method)

1
Do you have find a solution ? I have the same problem. - David-IT
Unfortunately no. - RealGigex

1 Answers

0
votes

The "Sforce-Call-Options" header is a comma delimited string, where each item in the string is a key value pair separated by equals.

Sforce-Call-Options: client=SampleCaseSensitiveToken/100, defaultNamespace=battle

If you're doing this in PHP, then you can reference this previous post.Salesforce callout using PHP