Newer Version Available

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

Call Options Header

The Call Options header is a request header applied when working with a specific client. Use this header to specify client-specific options when accessing REST API resources. The Call Options header can be used with the following resources: SObject Basic Information, SObject Rows, Query, QueryAll, Search, and SObject Rows by External ID.

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. Use this field to 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 in your package called botId, you can set the default namespace as follows:
1Sforce-Call-Options: client=SampleCaseSensitiveToken/100, defaultNamespace=battle
Then queries such as the following will succeed:
1/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 field allows you to write client code without having to specify the namespace prefix. Without this field specified, the full name of the field would have to be used for the query to succeed. In the example above, you would have to specify battle__botId__c.

Note that if this field is set, and the query specifies the namespace as well, the response will not 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 would use a botId__c element, not a battle_botId__c element.

The defaultNamespace field is ignored when retrieving describe information, so there will be no ambiguity between fields with namespace prefixes and customer fields of the same name without the prefix.