[英]How to add the CallOptions header using the salesforce REST API in PHP
我使用REST api將我的wordpress網站的數據同步到salesforce。 我希望在一個報告中看到api調用的來源,我發現我可以在“CallOptions”標題中使用客戶端ID。
我的參考: https : //developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/headers_calloptions.html
從該頁面:
Field name
Sforce-Call-Options
Field values
client—A string that identifies a client.
defaultNamespace—A string that identifies a developer ...
我的問題是,我如何編寫頭數組(正確的語法)來包含調用選項標題只有帶有值的“客戶端”。
我試過'headers' => array('Sforce-Call-Options' => 'My-Client-Name')
但客戶端ID沒有顯示在報告中。 另外,在salesforce環境中我可能需要做些什么,因為這是REST? 我設法在SOAP中添加它(使用“setCallOptions”方法)
“Sforce-Call-Options”標頭是逗號分隔的字符串,其中字符串中的每個項目都是由equals分隔的鍵值對。
Sforce-Call-Options: client=SampleCaseSensitiveToken/100, defaultNamespace=battle
如果你在PHP中這樣做,那么你可以參考上一篇文章。 使用PHP的Salesforce標注
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.