Salesforce Postman Integration - A Short Guide
Connected App is provided by Salesforce to connect with the platform from any other application.
Getting Started with Salesforce Connected App:
- Goto Setup, Search for App manager in Salesforce's Quick Search bar and click the New Connected App button.
- Enter the name of the connected app, the API name, and the contact information.
- Select Enable OAuth Settings.
- Provide Call Back Url.
- Select Access and manage your data (API)‘ in Available OAuth Scopes.
- Click the save button and then continue.
- Now you will get the consumer key and consumer secret, these two are required for Authentication.
Don't forget to check out: Integration Through JWT FLOW | Server-to-Server Integration | Salesforce
Postman is an application that is used for testing APIs for any platform (such as Salesforce, NET, PHP, etc.) as well as to verify that these APIs are working properly.
Getting Started with Postman:
- Download and install the Postman.
- Now we have to give the URL and 5 required parameters to get the Access Token of Salesforce Org.
- Select Body and then form-data and give the parameter:
Key: -Username, Value:- org Username.
Key: Password, Value:- org Password.
Key:grant_type, Value:- Password
Key:Client_id, Value:- Consumer Key
Key:Client_secret, Value:- Consumer Secret
- Please select a posting method and click the send button.
- Now you will get instance_url, Access token and Token type.
Retrieving Data from Salesforce:
- Give the URL.
- instanceUrl:-In this, we have to give the instance Url we got from the token API in the last step.
- Objectname: Provide the name of the object in this parameter.
- ID: This is the ID of the record we are looking for.
- Select Get Method.
- In the header section provide the access token.
- You will be able to view the recorded details by clicking the send button in response.
Check out another amazing blog by Nikhil here: OAuth 2.0 Device Authorization Flow in Salesforce
Creating a Record in Salesforce:
- Give the URL.
Sample URL: https://instanceurl/services/data/v25.0/sobjects/Objectname
- instanceUrl:- In this, we have to give the instance URL we got from the token API.
- Objectname: The object name here is the name of the object we want to create a record for.
- Select Post method to create the record.
- Provide the Access Token in the Header Section.
- Select body section and then select ROW and then provide the record details in XML or JSON format.
- Click on the send button.
- The new record you created from Postman will appear in Salesforce.