Newer Version Available

This content describes an older version of this product. View Latest

Call Options Header

Specifies client-specific options when accessing REST API resources. For example, you can write client code that ignores namespace prefixes by specifying the prefix in the call options header.

The Call Options header can be used with sObject Basic Information, sObject Rows, Query, QueryAll, Search, and sObject Rows by External ID. It is also supported in Bulk API 2.0.

Header Field Name and Values

Field name
Sforce-Call-Options
Field values
  • client—A string that identifies a client.
  • defaultNamespace—A string that identifies a developer namespace prefix. Resolve field names in managed packages without having to specify the namespace everywhere.
Example
If the developer namespace prefix is battle, and you have a custom field called botId in a package, set the default namespace with the call options header:
1Sforce-Call-Options: client=SampleCaseSensitiveToken/100, defaultNamespace=battle
Then queries such as the following succeed:
1/services/data/vXX.X/query/?q=SELECT+Id+botID__c+FROM+Account

In this case, the actual field queried is the battle__botId__c field.

Using this header allows you to write client code without having to specify the namespace prefix. In the previous example, without the header you must write battle__botId__c.

If this field is set, and the query also specifies the namespace, the response doesn’t include the prefix. For example, if you set this header to battle, and issue a query like SELECT+Id+battle__botID__c+FROM+Account, the response uses a botId__c element, not a battle_botId__c element.

The defaultNamespace field is ignored when retrieving describe information, which avoids ambiguity between namespace prefixes and customer fields of the same name.