Newer Version Available
getRESTAPISessionKey()
Returns the Salesforce REST API session key.
Use this method when your embedded app needs to interact with the Salesforce REST API, such as executing a SOQL query.
Don’t use the session key to manage custom objects or fields. You can use the session key to create and update object records. Apps that use lightning:container should work with data, not metadata.
Sample
Used within a JavaScript app uploaded as a static resource and referenced by lightning:container, this example gets the REST API session key
and uses it to execute a SOQL query.
You can view and download this example in the Developerforce Github Repository.
Arguments
None.
Response
| Name | Type | Description |
|---|---|---|
| key | string | The REST API session key. |