How to Integrate Salesforce and Postman for API Testing

How to Integrate Salesforce and Postman for API Testing
On June 20, 2023, Posted by , In Salesforce Integration,Uncategorized

An environment for developing APIs called Postman is used to test APIs, create and execute automated tests, observe reactions, and perform many other tasks. You can use a mail carrier as a Salesforce administrator or developer to test API responses. Let’s look at how to set up Postman Salesforce Rest API to test your APIs in this manner.

Publish a Linked App

Connect Postman to Salesforce Organization Search for App in the Quick Find box under SETUP and select Linked App.

When you select New, you will be taken to the following screen where you can build a new associated app:

Publish a Linked App

Provide the Linked App Name, API Name, and Contact Email in all relevant fields. The linked application name is Test Postman, the API name is automatically filled in as Test Postman, and I have inserted my email address into the contact email field.

Check the Enable OAuth Settings checkbox in API (Enable OAuth Settings).

This is extremely similar to when we create a related application for any external employee that is used for employee-to-employee communication since we will use Mailman, so the Callback URL doesn’t affect us. Any URL can be created there. It is essentially the URL where, in the event of OAuth, the authorization code will be sent. I have made use of SalesForce.com.

Choose Access and deal with your information (programming interface) under the Chosen OAuth Scopes section and transfer it from the Available OAuth Scopes to the Selected OAuth Scopes region.

The main decision is which APIs you want to use. For example, if you want to use the jabber programming interface, add it to the Chosen OAuth Scopes area. The process is similar to other programming interfaces.

As I will be using framework overseer certifications, the Access and manage your information (programming interface) is adequate for us to use standard Salesforce APIs to manage our information and any bespoke APIs we create in peak.

Test Postman

Test Postman

 

We have a Customer Key and Consumer Secret, which are available under the API (Enable OAuth Settings) part, as should be clear from the image above. The customer key will be immediately apparent to you, and for the customer, a mystery clicks on the “Click to unmask connection” link, where it will be shown.

Install and set up Postman

After your download and installation are finished, you will see a screen similar to the one below. This page will provide numerous methods, including “GET, PUT, and POST”.

3

We have two options for interacting with our Salesforce organization: Username Password Flow and Authorization Code Flow. The Username Password stream will now be used.

Getting the admission token is the next step. But if you’re using a sandbox, you can use https://test.salesforce.com/administrations/oauth2/token as the symbolic URL. If you’re interacting with your organization, use https://login.salesforce.com/administrations/oauth2/token as the URL to receive the entry token.

You must enter a few attributes as shown below in the body tab of the solicitation with the solicitation technique set to POST.

4

Make sure to select the building information radio catch. Currently, we must add 5 key esteem combinations, as seen in the above image and listed below: –

Username: Key; Value:

Value: “your organization’s login password” Key: “secret key.”

grant type | secret phrase as the Value

Client ID is the Key.

Client secret Key: Value

If you combine all the characteristics and click Submit, you may assume that to be how it appears in the initial image. It reads:

initial image

If your response was successful, you’ll receive the access token in the JSON and can move on to the section below that describes how to use the standard Salesforce API. But, if the scenario above applies, you must include your security token and secret phrase. If you already have a security token, use it; otherwise, click on your username and select My Settings to obtain another security token. You can find an option to Reset My Security Token Snap-On by typing reset into the search bar on the left. Choose Reset Security Token from the menu.

You can now browse the emails associated with your Salesforce Integration with Postman organization to find the new security token. Because the security token is case-sensitive, please make a copy from your mail and attach it to your secret Key in the mailman.

For instance, if your secret phrase is “iamawesome” and your security token is “123123123,” the Value should be your secret phrase connected to the security token, for example, “123123123,” in the secret word key of your mailman request. Once more, pressing the Send button will result in the reaction shown below:-

6

As seen in the screenshot above, the JSON response will look like this: –

access token

Connect to the Salesforce API

For now, we need to use Mailman to query our Salesforce Org records to demonstrate. It would be best if you made a solicitation to your case URL this time. The base URL of your company is the occurrence URL. For instance, the URL of my engineering company is https://ap5.salesforce.com.

For conventional APIs, you can look into the REST API engineer control. As an example, I currently need information. Therefore, I’m prepared to find it at https://developer.salesforce.com/docs/atlas.en-us.api rest—meta/api rest/resources query.htm.

Programming interface updates are continuously made; I use v42.0 and a simple query like SELECT Name, Type FROM Account. This will be a GET request, and I’ll set the Key in the header as follows:

Authorization and Value: – The bearer carries the entrance token variety (from the past JSON reaction).

I’ll go to this website’s URL: https://ap5.salesforce.com/administrations/information/v42.0/inquiry/?q=SELECT+Name,Type+FROM+Account

As a result, the final request and response after pressing “Send” are as follows:

get

How to Integrate Postman and Salesforce

Introduction to the Salesforce and Postman Integration:

  1. The salesforce Click on the Create Connected App Button after typing “App management” into the Quick Search bar.

lightning experience app manager

app manager

  1. Fill out the Linked App Name, API Name, and Contact information now.
  2. Make sure OAuth Settings are enabled.
  3. Provide a callback URL.
  4. On the list of available OAuth scopes, choose Access and Manage your data (API).
  5. After pressing “Save,” go ahead and continue.
  6. The consumer key and consumer secret, which are necessary for authentication, will now be given to you.
Contact Us
AwsQuality helps businesses gain competitive edge with solutions on Salesforce cloud and mobile technologies with Offices Noida India, Louisiana focused customers are in the UK, US, Asia, South America and Australia.