Get a Record Using an External ID
You can use the GET method of the sObject Rows by External ID resource to get records with a specific external ID.
The following example assumes there is a Merchandise__c custom object with a MerchandiseExtID__c external ID field.
Example usage for retrieving a Merchandise__c record using an external ID
1curl https://MyDomainName.my.salesforce.com/services/data/v67.0/sobjects/Merchandise__c/MerchandiseExtID__c/123 -H "Authorization: Bearer token"Example request body
none required
Example response body
1{
2 "attributes" : {
3 "type" : "Merchandise__c",
4 "url" : "/services/data/v67.0/sobjects/Merchandise__c/a00D0000008oWP8IAM"
5 },
6 "Id" : "a00D0000008oWP8IAM",
7 "OwnerId" : "005D0000001KyEIIA0",
8 "IsDeleted" : false,
9 "Name" : "Example Merchandise",
10 "CreatedDate" : "2012-07-12T17:49:01.000+0000",
11 "CreatedById" : "005D0000001KyEIIA0",
12 "LastModifiedDate" : "2012-07-12T17:49:01.000+0000",
13 "LastModifiedById" : "005D0000001KyEIIA0",
14 "SystemModstamp" : "2012-07-12T17:49:01.000+0000",
15 "Description__c" : "Merch with external ID",
16 "Price__c" : 10.0,
17 "Total_Inventory__c" : 100.0,
18 "Distributor__c" : null,
19 "MerchandiseExtID__c" : 123.0
20}