For businesses to grow faster and more efficiently, sometimes we may require connecting a CRM with an ERP solution, like the integration of Salesforce, a cloud-based CRM solution with an external application such as SAP ERP as it cannot provide access to everyone. So, here Salesforce provides a framework called the connected app to integrate it with any external application using APIs and standard protocols. In this article, we are going to explain the creation of a connected app in Salesforce, a step-by-step process to connect to Salesforce CRM with Postman using REST API, and an example to retrieve and create a record using postman.
Are you ready to try our
Introduction to Salesforce:
- Salesforce is a cloud-based CRM platform (Customer Relationship Management). It brings customers and companies together.
- It is one integrated CRM that gives all department including:
- Marketing
- Sales
- Commerce and service
- It is written in Java and uses the REST API protocol.
- It is easy to use, customizable and is a mobile-based CRM.
Introduction to Postman:
Postman is a desktop and web app for testing APIs without writing code. You can save requests, set headers, and inspect responses all in one place. It helps you see exactly how an API behaves before you build it into your app. Teams share collections to stay in sync and speed up testing.
Salesforce Connected App
Salesforce provides a Connected App to connect with the platform with any other application.
A connected app is an application that allows an external application to integrate with Salesforce using APIs and standard protocols.
Getting started with Salesforce Connected App:
Following are the steps to create a connected app in salesforce:
1. In Salesforce, navigate to Setup->Build->Create->Apps
2. Then go to Connected Apps for creation.
3. Now choose the New Button to create a new connected app.
4. Enter all the required information for the application.
5. Select Enable OAuth Settings.
6. Now provide a Callback URL and choose ‘Access and manage your data(api)‘ in Selected OAuth Scopes.
7. Click on Save and Continue.
Are you ready to try our
8. Click on your connected app.
9. Now, make a note of consumer key and consumer secret as these are required to authenticate.
10. In order to get a consumer secret, click on Reveal.
Understanding Basics of Postman:
Postman is an application for interacting with HTTP API. It is an interactive and automatic tool for verifying the APIs. It works in the backend and makes sure that each API is working.
Getting Started with Postman:
Install Postman by going to Postman Apps or Google Chrome.
The above screen will be displayed after launching the postman.
Integrating Salesforce using Postman
Step-by-step procedure for Authentication, Get Operation and Post Operation.
Step 1: Authentication
- Authentication is used for getting access token and instance URL.In order to get access token, we have to set up the HTTP login request URL.
- In the login URL, Client_id, Client_secret, Username, Password, Grant_type are the required fields. The structure of Url is shown below:
https://login.salesforce.com /services/oauth2/token?grant_type=password& client_id=YourConsumerKey& client_secret=YourConsumerSecret &username=SalesforceUserName &password= SalesforcePassword
- Use the ‘POST’ method for the login URL.
- Provide the URL below to login and click on Save.
On successful login, we will get instance_url, Access token and Token type. This access token is further used as a parameter in the header to send HTTP requests.
Step 2: Retrieving details of record from Salesforce
- In order to retrieve a record from salesforce ‘GET’ action is used. Below is the sample URL to fetch the details:
- https://instanceurl/services /data/v25.0/sobjects /Objectname/Id
- Instance url: Instance url that we get in response of login URL.
- Object name: Object name includes standard objects like Account, Contact etc.
- Id: This is the salesforce Id of the particular record we are trying to fetch.
- https://instanceurl/services /data/v25.0/sobjects /Objectname/Id
- Create a ‘GET‘ method and put a URL.
- In the headers section, copy access token with its token type as shown below:
- Now, click on Send and you will get details of the record in response.
Are you ready to try our
Step 3: Creating a new record in salesforce
- In order to create a new record in salesforce, we have to use the ‘POST‘ method.
- Below is the sample URL to create a new record:
- https://instanceurl/services /data/v25.0/sobjects /Objectname
- instance url: Instance URL that we get in response to the login URL.
- Objectname: Object name includes a particular object that we are trying to create.
- To create a record, use the ‘POST’ method and put the URL.
In the headers section, copy access token and in the body section, provide the details of a record in XML or JSON format. Here, I’m using the JSON format.
- Now, click on the send button.
- In response, you will get a Salesforce Id.
Testing Salesforce REST API Using Postman
With Postman you can call Salesforce endpoints step by step and watch the results. Follow these steps to test your REST API:
Step 1: Configure Your Environment
Create a new Postman environment and add variables for your client ID, secret, username, password, and Salesforce login URL. This saves you from typing long URLs each time. You can switch between sandbox and production by swapping environments.
Step 2: Authenticate & Token
Send a POST request to this link: https://login.salesforce.com/services/oauth2/token
In the form-data, include these details:
- grant_type
- client_id
- client_secret
- username
- password
Step 3: Retrieve a Record
Use a GET request to {{instance_url}}/services/data/v52.0/sobjects/Account/{{recordId}}. In the Headers tab, set Authorization to Bearer {{access_token}}. Send the request and examine the JSON body for field values and metadata.
Step 4: Create a New Record
Switch to a POST request at {{instance_url}}/services/data/v52.0/sobjects/Account/. In Headers, include Authorization: Bearer {{access_token}} and Content-Type: application/json. In the Body tab, paste your JSON payload (e.g., {“Name”:”Test Corp”}). Send it and note the new id in the response.
Step 5: Verify and Debug
Check the HTTP status codes for success (201) or errors (400, 401). Use Postman’s Console (View → Show Postman Console) to see raw request and response details. Tweak your payload or headers until calls succeed reliably.
Advantages of Using Salesforce and Postman with REST API
Combining Postman and Salesforce REST API greatly speeds up development and testing. You can iterate calls quickly, catch errors early, and share setups across your team.
- Quickly obtain and reuse OAuth tokens
- Easily switch between sandbox and production URLs
- View raw JSON responses for fast debugging
- Save and organize requests into collections
- Automate tests with pre-request and test scripts
- Share environments and collections with teammates
Validate API behavior before coding integrations
APPSeCONNECT is a smart and robust integration and business process automation platform that seamlessly connects Salesforce with all your business applications to streamline operations and facilitate the free flow of data across the platforms. By moving into the region of iPaaS, APPSeCONNECT proves to be a best-in-the-class platform that easily connects systems and automates the business process.
Now, you can easily connect all your business applications under one single platform to automate the business process!
Are you ready to try our