Hey guys, today in this post we are going to learn about How to Handling POST, PUT, PATCH and DELETE Requests Rest API in postman request in Salesforce.
Final Output →
Get Access Token
Method:- Post
URL:- https://login.salesforce.com/services/oauth2/token?grant_type=password&client_id=3MVG9fe4g9fhX0E4VMI4vmhIgc3fISaldH3KjsBnWKMFMuoPrmsU1W.K3X2gm.yC0xP2EH5NLjhyEiJ&client_secret=0C9A28886564ED36855929B7CC67517826AFB769C2DFBCEE6BC265B70B&password=delhi@123&username=vijay.kumar6799@gmail.com
Query Params
Key | Value |
---|---|
grant_type | password |
client_id | 3MVG9fe4g9fhX0E4VMI4vmhIgc3fISaldHyZzoDa3KjsBnWKMFMuoPrmsU1W.K3X2gm |
client_secret | 0C9A28886564ED36855929B7CC67517826AFBAEA8C2769C2D |
password | demo@123 |
username | vijay.kumar6799@gmail.com |
Send Request Output
1 2 3 4 5 6 7 8 |
{ "access_token": "00D5g000007oJsa!AQUAQBqnIYqdxDY4Z9rPKdWtRru2fwVrRZrnwGNSIr.cLPC2CdA5LOZ1mxufQX2kAOK1br_DNMSabgt2ZJmOvcuKQaJ83KLT", "instance_url": "https://rif-dev-ed.my.salesforce.com", "id": "https://login.salesforce.com/id/00D5g000007oJsaEAE/0055g00000AUd9MAAT", "token_type": "Bearer", "issued_at": "1662210874032", "signature": "KDh7gXXKo14JwMALsZnaZanrguidtTEKx82Io5vdjNY=" } |
Insert Multiple Accounts
Method:- POST
URL:- https://rif-dev-ed.my.salesforce.com/services/data/v52.0/composite/tree/Account/
Authorization Type:- Bearer Token
Authorization:- 00D5g000007oJsa!AQUAQBqnIYqdxDY4Z9rPKdWtRru2fwVrRZrnwGNSIr.cLPC2CdA5LOZ1mxufQX2kAOK1br_DNMSabgt2ZJmOvcuKQaJ83KLT
API Type:- JSON
Send Body Request
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
{ "records" :[ { "attributes" : {"type" : "Account", "referenceId" : "ref1"}, "name": "w3web Acc1", "phone": "1231231231", "Industry":"Technology" }, { "attributes" : {"type" : "Account", "referenceId" : "ref2"}, "name": "w3web Acc2", "phone": "1231231231", "Industry":"Chemicals" } ] } |
Send Request Output
1 2 3 4 5 6 7 8 9 10 11 12 13 |
{ "hasErrors": false, "results": [ { "referenceId": "ref1", "id": "0015g00000nvRIjAAM" }, { "referenceId": "ref2", "id": "0015g00000nvRIkAAM" } ] } |
Get Account Record from API
Method:- GET
URL:- https://rif-dev-ed.my.salesforce.com/services/data/v52.0/sobjects/Account/0015g00000nvRIjAAM
Authorization Type:- Bearer Token
Authorization:- 00D5g000007oJsa!AQUAQBqnIYqdxDY4Z9rPKdWtRru2fwVrRZrnwGNSIr.cLPC2CdA5LOZ1mxufQX2kAOK1br_DNMSabgt2ZJmOvcuKQaJ83KLT
Send Request Output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
{ "attributes": { "type": "Account", "url": "/services/data/v52.0/sobjects/Account/0015g00000nvRIjAAM" }, "Id": "0015g00000nvRIjAAM", "IsDeleted": false, "MasterRecordId": null, "Name": "w3web Acc1", "Type": null, "ParentId": null, "BillingStreet": null, "BillingCity": null, "BillingState": null, "BillingPostalCode": null, "BillingCountry": null, "BillingLatitude": null, "BillingLongitude": null, "BillingGeocodeAccuracy": null, "BillingAddress": null, "ShippingStreet": null, "ShippingCity": null, "ShippingState": null, "ShippingPostalCode": null, "ShippingCountry": null, "ShippingLatitude": null, "ShippingLongitude": null, "ShippingGeocodeAccuracy": null, "ShippingAddress": null, "Phone": "1231231231", "Fax": null, "AccountNumber": null, "Website": null, "PhotoUrl": "/services/images/photo/0015g00000nvRIjAAM", "Sic": null, "Industry": "Technology", "AnnualRevenue": null, "NumberOfEmployees": null, "Ownership": null, "TickerSymbol": null, "Description": null, "Rating": null, "Site": null, "OwnerId": "0055g00000AUd9MAAT", "CreatedDate": "2022-09-03T13:29:00.000+0000", "CreatedById": "0055g00000AUd9MAAT", "LastModifiedDate": "2022-09-03T13:29:00.000+0000", "LastModifiedById": "0055g00000AUd9MAAT", "SystemModstamp": "2022-09-03T13:29:00.000+0000", "LastActivityDate": null, "LastViewedDate": "2022-09-03T13:29:00.000+0000", "LastReferencedDate": "2022-09-03T13:29:00.000+0000", "Jigsaw": null, "JigsawCompanyId": null, "CleanStatus": "Pending", "AccountSource": null, "DunsNumber": null, "Tradestyle": null, "NaicsCode": null, "NaicsDesc": null, "YearStarted": null, "SicDesc": null, "DandbCompanyId": null, "OperatingHoursId": null, "CustomerPriority__c": null, "SLA__c": null, "Active__c": null, "NumberofLocations__c": null, "UpsellOpportunity__c": null, "SLASerialNumber__c": null, "SLAExpirationDate__c": null, "Budget__c": null, "Employee__c": null, "Status__c": null, "Latest_Caes_Number__c": null, "Office_Location__c": null, "Address__c": null } |
Patch (Update) Account Record
Method:- PATCH
URL:- https://rif-dev-ed.my.salesforce.com/services/data/v52.0/composite/sobjects
Authorization Type:- Bearer Token
Authorization:- 00D5g000007oJsa!AQUAQBqnIYqdxDY4Z9rPKdWtRru2fwVrRZrnwGNSIr.cLPC2CdA5LOZ1mxufQX2kAOK1br_DNMSabgt2ZJmOvcuKQaJ83KLT
API Type:- JSON
Send Body Request
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
{ "allOrNone": false, "records": [ { "attributes": { "type": "Account", "referenceId": "ref1" }, "Id": "0015g00000nvRIkAAM", "name": "w3web Acc1", "phone": "1231231231", "Industry":"Technology" } ] } |
Send Request Output
1 2 3 4 5 6 7 |
[ { "id": "0015g00000nvRIkAAM", "success": true, "errors": [] } ] |
Further post that would you like to learn in Salesforce
What is the Postman API?
The Postman API endpoints enable you to integrate Postman within your development toolchain. You can add new collections, update existing collections, update environments, and add and run monitors directly through the API. This enables you to programmatically access data stored in your Postman account.
What is Postman and why it is used?
Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs.
What is the difference between JSON and REST API?
JSON is based on a subset of the JavaScript Programming Language. Representative State Transfer (REST) is a client-server architectural style that uses the HTTP protocol in a simple and effective way. Systems that adhere to REST practices are often referred to as RESTful interfaces.
Related Topics | You May Also Like
- Your reaction of the article ▾