How to fetch data using External Id in Salesforce REST API?

How to fetch data using External Id in Salesforce REST API?

End Point URL:

https://yourInstance.salesforce.com/services/data/v52.0/sobjects/ObjectAPIName/ExternalIdFieldAPI Name/ExternalIdValue

Example:

https://infallibletechie5-dev-ed.my.salesforce.com/services/data/v51.0/sobjects/Employee__c/Email__c/[email protected]

Workbench:

Reference Article – https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/using_resources_retrieve_with_externalid.htm

To use Postman client, use the below steps.

1. Create a Connected App. Update the Callback URL as per your domain URL.

Callback URL Syntax:

https://{domain URL}.salesforce.com/services/oauth2/callback

2. Use the Consumer Key and Consumer Secret from the Connected app.

3. Do POST request and get the access token.

4. Do GET request with the access_token from step 3 and get the data.

Leave a Reply