Sforce Call Options Header

Use the Sforce-Call-Options header to specify client-specific options when accessing Bulk API 2.0 resources.

Header Field Name and Values

Field name
Sforce-Call-Options
Field values
  • client—A string that identifies a client, for use, for example, in event log files.
  • 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:
Sforce-Call-Options: client=CaseSensitiveToken, defaultNamespace=battle
Then queries such as the following succeed:
/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.