$Api

A global merge field type to use when referencing API URLs.

Usage

Use dot notation to specify an API URL from either the Enterprise or Partner WSDL, or to return the session ID.

Important

Important

$Api.Session_ID returns different values depending on the domain of the request. This is because the session ID varies during a session whenever you cross a hostname boundary, such as .salesforce.com to .visual.force.com. Normally Salesforce transparently handles session hand-off between domains, but if you’re passing the session ID around yourself, be aware that you might need to re-access $Api.Session_ID from the right domain to ensure a valid session ID.

Example

  • {!$Api.Enterprise_Server_URL__xxx}: The Enterprise WSDL SOAP endpoint where xxx represents the version of the API. For example, {!$Api.Enterprise_Server_URL_260} is the expression for the endpoint for version 26.0 of the API.
  • {!$Api.Partner_Server_URL__xxx}: The Partner WSDL SOAP endpoint where xxx represents the version of the API. {!$Api.Partner_Server_URL_250} is the expression for the endpoint for version 25.0 of the API.
  • {!$Api.Session_ID}: The session ID.
Previous
Next