Postman Request 0: Authorization
I have already covered the Salesforce authorization method by using SOAP method in my articles on SOAP Salesforce Authorization with Postman (no OAuth) and Automating Salesforce sessionId Retrieval in Postman for SOAP APIs, so I won’t repeat myself here. Go check those articles to get more info on that step.
In each of the following requests, we must include these headers:
KEY | VALUE |
Authorization | Bearer {{sessionId}} |
The {{sessionId}} key and values are dynamically set as an environment variable based on the Authorization request results.
Postman Request 1: GET Contact Object record data
Request: GET
Path: https://fun-inspiration-5108.my.salesforce.com/services/data/v58.0/sobjects/Contact
Body: None
Response
{
"objectDescribe": {
"activateable": false,
"associateEntityType": null,
"associateParentEntity": null,
"createable": true,
"custom": false,
"customSetting": false,
"deepCloneable": false,
"deletable": true,
"deprecatedAndHidden": false,
"feedEnabled": true,
"hasSubtypes": false,
"isInterface": false,
"isSubtype": false,
"keyPrefix": "003",
"label": "Contact",
"labelPlural": "Contacts",
"layoutable": true,
"mergeable": true,
"mruEnabled": true,
"name": "Contact",
"queryable": true,
"replicateable": true,
"retrieveable": true,
"searchable": true,
"triggerable": true,
"undeletable": true,
"updateable": true,
"urls": {
"compactLayouts": "/services/data/v58.0/sobjects/Contact/describe/compactLayouts",
"rowTemplate": "/services/data/v58.0/sobjects/Contact/{ID}",
"approvalLayouts": "/services/data/v58.0/sobjects/Contact/describe/approvalLayouts",
"listviews": "/services/data/v58.0/sobjects/Contact/listviews",
"describe": "/services/data/v58.0/sobjects/Contact/describe",
"quickActions": "/services/data/v58.0/sobjects/Contact/quickActions",
"layouts": "/services/data/v58.0/sobjects/Contact/describe/layouts",
"sobject": "/services/data/v58.0/sobjects/Contact"
}
},
"recentItems": [
{
"attributes": {
"type": "Contact",
"url": "/services/data/v58.0/sobjects/Contact/003KB000005w2MMYAY"
},
"Id": "003KB000005w2MMYAY",
"Name": "Benioff, Marc"
},
{
"attributes": {
"type": "Contact",
"url": "/services/data/v58.0/sobjects/Contact/003KB000004gli6YAA"
},
"Id": "003KB000004gli6YAA",
"Name": "Great, Peter The"
}
]
}
When we look at the response, we will see that there are 2 items (contacts) listed. When we compare that to our Salesforce end, we will see that these data are matching the Total Contacts perfectly:
Now, we could test if this data gets adequately updated from the Postman end if we add a new contact from the Salesforce end.
Updating a new contact in Salesforce
We are adding pseudo-Donald Trump as our new contact:
The contact is added to the Contacts object. Let’s see if this change is visible from the Postman side as well.
Postman Request 2: GET Donald Trump as a new item
Request: GET
Path: https://fun-inspiration-5108.my.salesforce.com/services/data/v58.0/sobjects/Contact
Body: None
Response
{
"objectDescribe": {
"activateable": false,
"associateEntityType": null,
"associateParentEntity": null,
"createable": true,
"custom": false,
"customSetting": false,
"deepCloneable": false,
"deletable": true,
"deprecatedAndHidden": false,
"feedEnabled": true,
"hasSubtypes": false,
"isInterface": false,
"isSubtype": false,
"keyPrefix": "003",
"label": "Contact",
"labelPlural": "Contacts",
"layoutable": true,
"mergeable": true,
"mruEnabled": true,
"name": "Contact",
"queryable": true,
"replicateable": true,
"retrieveable": true,
"searchable": true,
"triggerable": true,
"undeletable": true,
"updateable": true,
"urls": {
"compactLayouts": "/services/data/v58.0/sobjects/Contact/describe/compactLayouts",
"rowTemplate": "/services/data/v58.0/sobjects/Contact/{ID}",
"approvalLayouts": "/services/data/v58.0/sobjects/Contact/describe/approvalLayouts",
"listviews": "/services/data/v58.0/sobjects/Contact/listviews",
"describe": "/services/data/v58.0/sobjects/Contact/describe",
"quickActions": "/services/data/v58.0/sobjects/Contact/quickActions",
"layouts": "/services/data/v58.0/sobjects/Contact/describe/layouts",
"sobject": "/services/data/v58.0/sobjects/Contact"
}
},
"recentItems": [
{
"attributes": {
"type": "Contact",
"url": "/services/data/v58.0/sobjects/Contact/003KB000004gqf5YAA"
},
"Id": "003KB000004gqf5YAA",
"Name": "Trump, Donald J."
},
{
"attributes": {
"type": "Contact",
"url": "/services/data/v58.0/sobjects/Contact/003KB000005w2MMYAY"
},
"Id": "003KB000005w2MMYAY",
"Name": "Benioff, Marc"
},
{
"attributes": {
"type": "Contact",
"url": "/services/data/v58.0/sobjects/Contact/003KB000004gli6YAA"
},
"Id": "003KB000004gli6YAA",
"Name": "Great, Peter The"
}
]
}
As we can see in this response, Donald Trump has been successfully updated as our new contact!
Update 3 new contacts and remove 1 existing one
Now, we will create 3 new contacts and remove Peter The Great from our contacts in Salesforce. Here we can see our Salesforce update:
3 new contacts (Elon Musk, Jordan Peterson, and Tulsi Gabbard) have been added, and Peter The Great has been removed. Let’s see if this change also reflects from the Postman side as well.
Postman Request 3: GET 3 new items and 1 removed
Request: GET
Path: https://fun-inspiration-5108.my.salesforce.com/services/data/v58.0/sobjects/Contact
Body: None
Response
{
"objectDescribe": {
"activateable": false,
"associateEntityType": null,
"associateParentEntity": null,
"createable": true,
"custom": false,
"customSetting": false,
"deepCloneable": false,
"deletable": true,
"deprecatedAndHidden": false,
"feedEnabled": true,
"hasSubtypes": false,
"isInterface": false,
"isSubtype": false,
"keyPrefix": "003",
"label": "Contact",
"labelPlural": "Contacts",
"layoutable": true,
"mergeable": true,
"mruEnabled": true,
"name": "Contact",
"queryable": true,
"replicateable": true,
"retrieveable": true,
"searchable": true,
"triggerable": true,
"undeletable": true,
"updateable": true,
"urls": {
"compactLayouts": "/services/data/v58.0/sobjects/Contact/describe/compactLayouts",
"rowTemplate": "/services/data/v58.0/sobjects/Contact/{ID}",
"approvalLayouts": "/services/data/v58.0/sobjects/Contact/describe/approvalLayouts",
"listviews": "/services/data/v58.0/sobjects/Contact/listviews",
"describe": "/services/data/v58.0/sobjects/Contact/describe",
"quickActions": "/services/data/v58.0/sobjects/Contact/quickActions",
"layouts": "/services/data/v58.0/sobjects/Contact/describe/layouts",
"sobject": "/services/data/v58.0/sobjects/Contact"
}
},
"recentItems": [
{
"attributes": {
"type": "Contact",
"url": "/services/data/v58.0/sobjects/Contact/003KB000004gqkZYAQ"
},
"Id": "003KB000004gqkZYAQ",
"Name": "Gabbard, Tulsi"
},
{
"attributes": {
"type": "Contact",
"url": "/services/data/v58.0/sobjects/Contact/003KB000004gpGQYAY"
},
"Id": "003KB000004gpGQYAY",
"Name": "Peterson, Jordan B."
},
{
"attributes": {
"type": "Contact",
"url": "/services/data/v58.0/sobjects/Contact/003KB000004gqkYYAQ"
},
"Id": "003KB000004gqkYYAQ",
"Name": "Musk, Elon"
},
{
"attributes": {
"type": "Contact",
"url": "/services/data/v58.0/sobjects/Contact/003KB000004gqf5YAA"
},
"Id": "003KB000004gqf5YAA",
"Name": "Trump, Donald J."
},
{
"attributes": {
"type": "Contact",
"url": "/services/data/v58.0/sobjects/Contact/003KB000005w2MMYAY"
},
"Id": "003KB000005w2MMYAY",
"Name": "Benioff, Marc"
}
]
}
If we look at this response, we will clearly see that the 3 new contacts were updated as expected, and Peter The Great has been removed as expected as well.
How to retrieve data for a single item (single contact)
If we look at the Contacts responses that we received in the previous steps, inside of the “urls” object we will find a few key-value pair items with paths we can use for testing.
"urls": {
"compactLayouts": "/services/data/v58.0/sobjects/Contact/describe/compactLayouts",
"rowTemplate": "/services/data/v58.0/sobjects/Contact/{ID}",
"approvalLayouts": "/services/data/v58.0/sobjects/Contact/describe/approvalLayouts",
"listviews": "/services/data/v58.0/sobjects/Contact/listviews",
"describe": "/services/data/v58.0/sobjects/Contact/describe",
"quickActions": "/services/data/v58.0/sobjects/Contact/quickActions",
"layouts": "/services/data/v58.0/sobjects/Contact/describe/layouts",
"sobject": "/services/data/v58.0/sobjects/Contact"
}
}
The one we are interested in is this one:
“rowTemplate”: “/services/data/v58.0/sobjects/Contact/{ID}”
Basically, we have to replace the {ID} with the “Id” value for the single contact that we want to test further. Let’s do it for Elon Musk, which means that we must use this Id => 003KB000004gqkYYAQ
Postman Request 4: GET a single item inside of Contacts
Let’s retrieve Elon Musk-related data by searching for it by ID value.
Request: GET
Path: https://fun-inspiration-5108.my.salesforce.com/services/data/v58.0/sobjects/Contact/003KB000004gqkYYAQ
Body: None
Response
{
"attributes": {
"type": "Contact",
"url": "/services/data/v58.0/sobjects/Contact/003KB000004gqkYYAQ"
},
"Id": "003KB000004gqkYYAQ",
"IsDeleted": false,
"MasterRecordId": null,
"AccountId": null,
"LastName": "Musk",
"FirstName": "Elon",
"Salutation": "Mr.",
"MiddleName": null,
"Suffix": null,
"Name": "Elon Musk",
"MailingStreet": null,
"MailingCity": null,
"MailingState": null,
"MailingPostalCode": null,
"MailingCountry": null,
"MailingLatitude": null,
"MailingLongitude": null,
"MailingGeocodeAccuracy": null,
"MailingAddress": null,
"Phone": null,
"Fax": null,
"MobilePhone": null,
"ReportsToId": null,
"Email": "[email protected]",
"Title": "Geek",
"Department": null,
"OwnerId": "005KB000000JP11YAG",
"CreatedDate": "2025-01-13T11:56:45.000+0000",
"CreatedById": "005KB000000JP11YAG",
"LastModifiedDate": "2025-01-13T11:56:45.000+0000",
"LastModifiedById": "005KB000000JP11YAG",
"SystemModstamp": "2025-01-13T11:56:45.000+0000",
"LastActivityDate": null,
"LastCURequestDate": null,
"LastCUUpdateDate": null,
"LastViewedDate": "2025-01-13T13:07:26.000+0000",
"LastReferencedDate": "2025-01-13T13:07:26.000+0000",
"EmailBouncedReason": null,
"EmailBouncedDate": null,
"IsEmailBounced": false,
"PhotoUrl": "/services/images/photo/003KB000004gqkYYAQ",
"Jigsaw": null,
"JigsawContactId": null
}
Postman Request 5: GET a previously deleted item
We have deleted Peter The Great from the Contacts record. Let’s see what response we will GET if we search for it by using the ID value we have previously stored => 003KB000004gli6YAA
The expected result should be 401 Not Found. Let’s see if that’s the case.
Request: GET
Path: https://fun-inspiration-5108.my.salesforce.com/services/data/v58.0/sobjects/Contact/003KB000004gli6YAA
Body: None
Response
[
{
"errorCode": "NOT_FOUND",
"message": "The requested resource does not exist"
}
]
The response was just as expected, and the response status received was 401.
Change some data for existing user in Contacts
Let’s imagine a scenario where Tulsi Gabbart decided to marry Elon Musk. Following that, she changed her last name to Gabbard-Musk and changed her email to [email protected]
The requested data has been updated in Salesforce. Let’s see how that reflects in Postman.
Postman Request 6: Check a single user’s recently changed data
Request: GET
Path: https://fun-inspiration-5108.my.salesforce.com/services/data/v58.0/sobjects/Contact/003KB000004gqkZYAQ
Body: None
Response
{
"attributes": {
"type": "Contact",
"url": "/services/data/v58.0/sobjects/Contact/003KB000004gqkZYAQ"
},
"Id": "003KB000004gqkZYAQ",
"IsDeleted": false,
"MasterRecordId": null,
"AccountId": null,
"LastName": "Gabbard-Musk",
"FirstName": "Tulsi",
"Salutation": "Mrs.",
"MiddleName": null,
"Suffix": null,
"Name": "Tulsi Gabbard-Musk",
"MailingStreet": null,
"MailingCity": null,
"MailingState": null,
"MailingPostalCode": null,
"MailingCountry": null,
"MailingLatitude": null,
"MailingLongitude": null,
"MailingGeocodeAccuracy": null,
"MailingAddress": null,
"Phone": null,
"Fax": null,
"MobilePhone": null,
"ReportsToId": null,
"Email": "[email protected]",
"Title": "Army Lady",
"Department": null,
"OwnerId": "005KB000000JP11YAG",
"CreatedDate": "2025-01-13T11:59:07.000+0000",
"CreatedById": "005KB000000JP11YAG",
"LastModifiedDate": "2025-01-13T13:31:10.000+0000",
"LastModifiedById": "005KB000000JP11YAG",
"SystemModstamp": "2025-01-13T13:31:10.000+0000",
"LastActivityDate": null,
"LastCURequestDate": null,
"LastCUUpdateDate": null,
"LastViewedDate": "2025-01-13T13:31:10.000+0000",
"LastReferencedDate": "2025-01-13T13:31:10.000+0000",
"EmailBouncedReason": null,
"EmailBouncedDate": null,
"IsEmailBounced": false,
"PhotoUrl": "/services/images/photo/003KB000004gqkZYAQ",
"Jigsaw": null,
"JigsawContactId": null
}
We can clearly see that the requested data was successfully updated.