The consumer key of the Connected App used to connect.
The URL of the connected Salesforce org.
Closes the connection with the currently connected Salesforce org. Stored auth keys are expired and removed.
Executes a custom REST API request to the specified endpoint.
Typically, every Salesforce REST API data endpoint must include the REST API version that is being requested. However, when calling the executeApiRequest
function you can either explicitly set the REST API version to call or simply use "vXX.X" to default to the REST API version set by the API.
For POST
/PATCH
requests, Content-Type
header is set to "application/json" by default and so data
parameter can simply be set to an object.
Note: depending on which REST API endpoint you attempt to request, you may need to add additional OAuth scopes to your Connected App.
A type that defines the expected response data. A number of response types suitable for common requests are included for convenience, such as SalesforceRestApiSObjectBasicInfoResponse, SalesforceRestApiQueryResponse, SalesforceRestApiSearchResponse and more.
The relative Salesforce REST API endpoint being requested (e.g. /services/data/vXX.X/sobjects/Contact
).
The HTTP Method to use when making the request (defaults to GET
).
Optional data to pass with the request (for POST
/PATCH
requests).
Optional headers to include with the request. Important: do not attempt to set the Authorization
header manually as the API will include it automatically (as long as includeAuthorization
is not set to false
).
Whether the Authorization
header will be added automatically. Set this to false
when making requests to endpoints that do not expect an Authorization
header, such as the OAuth endpoints.
A {@link SalesforceRestApiResponse response} object containing the status code and response data (if provided). The data is expected to be of the given generic type, but this is not enforced.
Retrieves the connection’s auth tokens from local storage.
An object containing the access and refresh tokens.
Generated using TypeDoc
Defines a connection to a Salesforce org.