One of the most important components of such a strategy is Customer Relationship Management (CRM), whose core tenet is to cater to the needs of your users to satisfy them and keep them happy at all times. Being able to use external applications such as Postman together with your CRM tool like Salesforce to achieve this level of satisfaction required by your customers is what this article is going to dwell on.

Postman is an API advancement environment that is used to test APIs, make robotized tests, get data or responses from your requests, and lots more. Connecting it with Salesforce through using the REST API goes a long way in helping you to manage your customers’ details effectively and reach out to them with tailored, specific information that suits them. 

In this article, you will be introduced to Postman and Salesforce. The steps involved to establish Salesforce REST API Postman will be discussed in detail. The advantages of Salesforce REST API Postman are also elaborated.

Introduction to Postman

Salesforce REST API Postman- Postman logo

Postman is an Application Programming Interface (API) development tool that helps you build, test, and modify APIs. Postman can also be regarded as a collaboration platform that aids API development and helps in the creation of better and faster APIs by simplifying each step in the process of building an APIs therefore, allowing streamlined collaborative efforts.

Postman boasts of almost all functional tools needed by developers as they are encapsulated on the platform thereby making it a popular API platform used by over 5 million developers monthly. It can handle various types of HTTP requests ranging from GET, POST, PUT, to PATCH, converting the API to code for other languages like JavaScript, Python, etc. Postman can also save your environments for later use.

Take a look at how REST API is different from an API and also understand the key differences between REST vs RESTful APIs to get a clear understanding of how a REST API functions.

Simplify Data Integration with Hevo

Building APIs with Postman REST API frameworks can streamline your development process. However, integrating data from multiple sources into your data warehouse for deeper insights can be challenging. Hevo Data makes this effortless.

Why Choose Hevo?

  • REST API Connector: Seamlessly fetch data from custom or non-native REST APIs and integrate it into your data warehouse.
  • No Code, Fully Automated: Hevo’s intuitive platform eliminates the need for manual coding, making it ideal for developers and non-technical teams.

Leverage Hevo to integrate data from 150+ sources, including REST APIs and Salesforce, databases, and SaaS applications, for analysis-ready data in minutes. 

Get Started with Hevo for Free

Introduction to Salesforce

Salesforce REST API Postman- Salesforce logo

Salesforce is a cloud-based Customer Relationship Management (CRM) platform that is used to create an avenue where companies can connect with clients, partners, and potential customers, bringing them together under one unit. 

Salesforce is used by marketing, sales, commerce, and service departments in corporations to ensure the company’s growth in marketing drives, increased sales, general commercial activities, and services.

Salesforce has a variety of modules such as Sales Cloud, Sales performance, Sales Collaboration, Marketing Cloud, etc. 

Salesforce is written in Java and uses the REST API protocol making it easy to use and it is highly customizable.

Salesforce Platform APIs

Salesforce provides several APIs to interact with its platform, making it easier to access and manage data. Here are the key Salesforce Platform APIs:

  1. REST API
    • The REST API allows you to interact with Salesforce data using standard HTTP methods (GET, POST, PUT, DELETE).
    • Best for web and mobile applications that require simple integration.
  2. SOAP API
    • A protocol-based API for exchanging structured data.
    • Ideal for systems requiring enterprise-level integrations.
  3. Bulk API
    • Designed to handle large volumes of data.
    • Useful for data migration, batch processing, and bulk updates.
  4. Streaming API
    • Enables real-time notifications for data changes using PushTopic and Event-based triggers.
    • Great for keeping external systems in sync.
  5. GraphQL API
    • A query-based API that allows fetching specific data in a single request.
    • Provides more control over data retrieval.
  6. Metadata API
    • Helps manage customizations like objects, fields, and configurations programmatically.
    • Useful for deploying and migrating metadata between environments.

These APIs enable developers to connect, customize, and extend Salesforce efficiently based on their project needs.

Connecting Postman to Salesforce

Salesforce REST API Postman: Salesforce Connected App

Salesforce provides an avenue known as Connected App in which other applications can connect with the platform. A Connected App is defined as an application that allows external applications to integrate with Salesforce using APIs and standard protocol.

To create a Connected App on Salesforce, you will have to switch your Salesforce org from classic view to lightning experience as a new Connected App can be created only from the app manager in lightning experience. After you have performed the switch, do the following steps:

  1. In Salesforce org, navigate to Setup and search for apps, then Build, Create, and click on Apps.
Salesforce REST API Postman creating Apps
Image Source: appseconnect
  1. Go to the Connected Apps section.
Salesforce REST API Postman navigating to connected apps section
Image Source: appseconnect
  1. Choose the New Button to create a new connected app.
Salesforce REST API Postman- new button in the connected app
Image Source: appseconnect
  1. In the form, enter the required information such as Connected App Name, API Name, Contact Email for the application.
  2. Select Enable OAuth Settings checkbox.
  3. Provide a Callback URL and choose Access and manage your data (API) and move it from the Available OAuth scopes to the Selected OAuth scopes section.
  4. Click on Save and Continue.
  5. Click on your connected app.
  6. Take note of your Consumer Key and Consumer Secret present in the API (Enable OAuth Settings) as these would be required for authentication. The Consumer Key is visible directly but to get the consumer secret, click on the Click to Reveal link to see it.
Salesforce REST API Postman- Testing Postman
Image Source: sfdcstop

The Salesforce part of the connection has been completed and you will now move on to the Postman connection.

Salesforce REST API Postman: Setting Up Postman

To setup Postman, do the following:

  1. Go to https://getpostman.com/apps and download Postman for your operating system.
Salesforce REST API Postman- downloading Postman
Image Source: sfdcstop
  1. Once Postman is installed, open it.
Salesforce REST API Postman- working on Postman
Image Source: sfdcstop
  1. To connect to Salesforce org, two options can be used. Authorization Code Flow and Username Password Flow. 
  2. To use Username Password Flow, the next step is to get the access token. To get the access token through connecting with your developer org, use https://login.salesforce.com/services/oauth2/token as the URL to get it and when using the sandbox, use https://test.salesforce.com/services/oauth2/token as the token URL.
  3. Set the request method to POST to get access to your Salesforce org and in the body tab, make sure that the form-data radio button is selected then fill in the parameters:
    • Key:- username | Value:- <your login username for org> Salesforce org username.
    • Key:- password | Value:- < your orgs login password> Salesforce org password with a security token.
    • Key:- grant_type | Value:- password
    • Key:- client_id | Value:- <consumer key of your salesforce org’s connected app>
    • Key:- client_secret | Value:- <consumer secret of your salesforce org’s connected app>
Salesforce REST API Postman- working on Postman
Image Source: sfdcstop
  1. After filling in the values, click on Send. 

If everything goes correctly, you will have a successful login and you will get your instance_url, access_token, and token type in the JSON. The access_token is used as a  parameter in the header to send HTTP requests.

Nonetheless, in a case where it was not successful, you will get an error message as shown below:

{
 “error”: “invalid_grant”,
 “error_description”: authentication failure”
}

You will need to input your security token along with your password to log in get your access_token.

Integrate REST API to PostgreSQL
Integrate Salesforce to BigQuery
Integrate Salesforce Marketing Cloud to Snowflake

Salesforce REST API Postman: Retrieving Records from Salesforce in Postman

To retrieve a record from Salesforce through Postman, the GET method will be used and you will need to pass your instance URL. An example of the URL is shown below with its parameters:

https://instanceurl/services/data/v25.0/sobjects/Objectname/Id

  • instance URL: This is the instance URL you get from a successful login.
  • Objectname: This refers to standard objects like Account Name, Contacts, etc.
  • Id: This is the Salesforce ID of the particular record to be retrieved. 

To retrieve the record, do the following

  1. Put your instance URL which is obtained from your login to Salesforce through Postman in the URL box. 
  2. In the header of the request, input the access token and token type.
    1. Key:- Authorization | Value Bearer + access-token
  3. Click Send. 

Upon clicking send,  you will get details of the record in response to your request. 

Salesforce REST API Postman- Postman response
Image Source: appseconnect

Salesforce REST API Postman: Creating a New Record in Salesforce from Postman

To create a new record in Salesforce, you will use the POST method with your instance URL. A sample URL is shown below with explanations for the parameters:

https://instanceurl/services/data/v25.0/sobjects/Objectname

  • instance URL: This is gotten from a successful login response. 
  • Objectname: This is the particular object name that you are trying to create.

As stated above, the POST method will be used in creating a record and the following steps will be carried out:

  1. Get your instance URL and access token from your login in Salesforce through the Postman tool.
  2. Enter your instance URL in the URL box. 
  3. In the header of the request, pass the Content-Type parameter and the Authorization parameter.
    1. Key:- Content-Type  | Value: application/JSON
    2. Key:- Authorization  | Value: Bearer + access token. 
  4. Select POST method request. 
  5. Pass JSON data in the body of the request since it is a POST method request. 
  6. Hit the send button to get a response on the newly created record id.
Salesforce REST API Postman- create a record
Image Source: appseconnect
Salesforce REST API Postman- creating a record
Image Source: appseconnect

Testing Salesforce REST API Using Postman

Postman is a popular tool for testing and interacting with APIs. Here’s how you can test Salesforce REST API using Postman:

  1. Set Up Postman
    • Download and install Postman.
    • Create a new workspace or collection for your Salesforce API testing.
  2. Obtain Salesforce Access Token
    • Use OAuth 2.0 to authenticate and get an access token.
    • Make a POST request to the Salesforce login endpoint (https://login.salesforce.com/services/oauth2/token).
    • Include your client ID, client secret, username, password, and grant type.
  3. Create and Test API Requests
    • Use the access token in the Authorization header as a Bearer Token.
    • Test endpoints like:
      • Retrieve Data: GET /services/data/vXX.X/sobjects/Account
      • Create Record: POST /services/data/vXX.X/sobjects/Account
      • Update Record: PATCH /services/data/vXX.X/sobjects/Account/{id}
      • Delete Record: DELETE /services/data/vXX.X/sobjects/Account/{id}
  4. Check Response
    • Postman displays the API response, including status codes, error messages, and JSON data.
    • Validate that the API is working as expected.
  5. Automate Tests
    • Use Postman’s Tests tab to write scripts that validate API responses automatically.

By using Postman, you can quickly test and debug Salesforce REST API calls without writing code, making the integration process efficient and hassle-free.

Advantages of Using Salesforce REST API Postman

The advantages of Salesforce REST API Postman are elaborated below:

  • Like the examples of GET and POST methods seen above,  all HTTP methods can be accessed using a custom API  through Postman. It gives you full control over all HTTP requests. 
  • There are no limits to file uploads as you can set headers and parameters, and use any content type such as binary, text, application, and so on.
  • Generation of code snippets for varieties of languages from your requests is possible on Postman.
  • You can build post execution scripts with JavaScript that can be used for setting environment variables.
  • It is easy to switch between multiple environments and whenever the switches occur, all variable values are updated to environment-specific values. For instance, you can have an environment for production and another one for a sandbox.
  • Postman allows you to collaborate on requests by importing/exporting your workspaces. It also has paid plans that couple Postman with source control for live collaboration.

Also, take a look at how you can use Salesforce Service Cloud Objects easily and also learn how you can effortlessly set up the Salesforce Object APIs step-by-step.

Conclusion

The article has shown you how to connect Postman to Salesforce using the connected app in your Salesforce org and subsequently testing your custom API in Salesforce from Postman using the access token you derived from a successful log-in. By now you will have complete knowledge of Salesforce REST API Postman.

Enhance your API development workflow with Postman, the go-to REST client for sending requests and analyzing responses. Find out more at Postman REST Client.

Doing all of these makes it easier for you to manage records on Salesforce as you can retrieve specific records based on your requirements and perform other operations, however, not having a firm understanding of the entire process can lead to drudgery. This is where Hevo Data comes in. Hevo Data is an all-encompassing data platform that can handle your data needs in an efficient and less complicated manner. It has several inbuilt connectors and integrators to a wide range of popular platforms inclusive of Salesforce.

Hevo Data offers a faster way to move data from 150+ Data Sources such as REST API for free, into your Data Warehouse to be visualized in a BI tool. Hevo is fully automated and hence does not require you to code. Hevo provides a pre-built Native REST API Connector that will allow you to integrate data from a plethora of custom and non-native sources. All this without writing a single line of code and free of cost. To delve deeper into this subject, Explore our Salesforce Apex REST API.

Try Hevo and see the magic for yourself. Sign up for a free 14-day trial to streamline your data integration process. You may examine Hevo’s pricing plans and decide on the best plan for your business needs.

Frequently Asked Questions

1. How do I connect REST API to Salesforce?

To connect REST API to Salesforce:
(i) Authenticate using OAuth 2.0 to get an access token.
(ii) Use the access token to make API requests to Salesforce endpoints.

2. Can Postman be used for REST API?

Yes, Postman is a tool to test and interact with REST APIs. You can send requests, view responses, and troubleshoot easily.

3. How to call Salesforce Flow from Postman?

(i) Get an access token via OAuth 2.0.
(ii) Use a POST request to:
/services/data/vXX.X/actions/custom/flow/{flowApiName}
(iii) Pass input values in JSON format in the body.

Ofem Eteng
Technical Content Writer, Hevo Data

Ofem Eteng is a seasoned technical content writer with over 12 years of experience. He has held pivotal roles such as System Analyst (DevOps) at Dagbs Nigeria Limited and Full-Stack Developer at Pedoquasphere International Limited. He specializes in data science, data analytics and cutting-edge technologies, making him an expert in the data industry.