Salesforce postman

Salesforce Integration with Postman - The How-to Guide

Postman is an API advancement environment that is utilized to test an API, make and run robotized tests, look at reactions, and do much more stuff. As a Salesforce Developer or Admin, you can utilize mailman to test APIs and their reactions. In this way, how about we perceive how to arrange postman to test your APIs.

Create a Connected App

In Salesforce org, Go to SETUP and search App in Quick Find box and click on Connected App
Click on New and will see the New page to create a new connected app that shows the below:

Advertisement

connected App

Enter all required fields like Connected App Name, API Name, and Contact Email. I am utilizing Test Postman as the associated application name, the API name is naturally populated as Test_Postman and I have added my email id in the contact email field.

In API(Enable OAuth Settings) check the Enable OAuth Settings checkbox true.
This is very like when we make an associated application at any outsider worker which is utilized for a worker to worker correspondence, as we will utilize mailman so the Callback URL doesn't influence us. You can compose any URL there. It is essentially the URL where the approval code will be sent if there should be an occurrence of OAuth. I have utilized https://www.salesforce.com

Under the Selected OAuth Scopes area, pick Access and deal with your information (programming interface) and move it from the Available OAuth Scopes to the Selected OAuth Scopes segment. It is essentially a decision of which APIs you need to utilize like on the off chance that you need to utilize a jabber programming interface, you have to add it to the Selected OAuth Scopes area and comparative methodology for some other programming interface.

To get to standard Salesforce APIs to manage our information and for any custom APIs too that we make in peak, the Access and deal with your information (programming interface) is sufficient for us as I will utilize framework overseer certifications.

test postman

As should be obvious in the above picture, we have a Consumer Key and Consumer Secret which is available in the API (Enable OAuth Settings) segment. The shopper key will be obvious to you straightforwardly and for the customer, mystery clicks on Click to uncover connection and it'll be shown there.

dont miss out iconDon't forget to check out: Sinergify: Tailor Your Unique Business Needs into Salesforce and Jira Integration

Download and Setup the Postman

When your Download and Installation process is complete, you have seen a page like below where you will get multiple Methods like ‘GET, PUT, and POST’.

Setup the Postman

To interface with our Salesforce organization, we've two alternatives:- Authorization Code Flow and Username Password Flow. We will utilize the Username Password stream now.

The following stage is to get the entrance token. In case you're interfacing with your designer organization, use:- https://login.salesforce.com/administrations/oauth2/token as the URL to get the entrance token in any case, in case you're utilizing a sandbox, you can utilize https://test.salesforce.com/administrations/oauth2/token as the symbolic URL.

Set the solicitation technique to POST and in the body tab, you have to enter a few qualities as demonstrated as follows:-

postman

Ensure that the structure information radio catch is chosen. Presently we have to add 5 key-esteem combines as appeared in the above picture and given beneath:-

Key:- username | Value:-

Key:- secret key | Value:- < your organizations login password>

Key:- grant_type | Value:- secret phrase

Key:- client_id | Value:-

Key:- client_secret | Value:-

Add all the qualities and snap-on Send, you could conceivably consider the to be as appeared in the above picture. It says:-

{ 
    "mistake": "invalid_grant", 
    "error_description": "confirmation disappointment" 
} 

On the off chance that you got the fruitful reaction, you'll get the access_token in the JSON and you can jump to the Hitting the Standard Salesforce API area beneath. Nonetheless if the above is the situation, you have to attach your security token alongside the secret phrase. In the event that you have a security token, utilize that something else, to get another security token, click on your username and snap-on My Settings. In the hunt bar on the left compose:- reset and you'll see an alternative indicating Reset My Security Token snap on. Click on Reset Security Token catch
Browse your email now which is related to your Salesforce organization and you'll get the new security token there. The security token is case delicate, so duplicate that from your mail and affix it alongside your secret key in mailman.

For eg:- in the event that your secret phrase is ‘iamawesome’ and your token is ‘123123123’, at that point in the secret word key of your mailman demand, the worth should be your secret word linked with the security token for example ‘123123123’. Snap-on the Send button again and you'll have the reaction as demonstrated as follows:-

postman setup

As you can see in the above image, you'll have a JSON response as follows:-

{
    "access_token": "<your-access-token>",
    "instance_url": "<your-org-base-url>",
    "id": "https://login.salesforce.com/id/<id>/<id>",
    "token_type": "Bearer",
    "issued_at": "<timestamp>",
    "signature": "<unique-signature-code>"
}

Hit the Salesforce API

Presently, for a demo, we should question our records from Salesforce Org utilizing mailman. This time, you have to make a solicitation to your case URL. The occurrence URL is fundamentally the base URL of your organization. For Ex:- My occasion URL of engineer organization is:- https://ap5.salesforce.com/

You can investigate the REST API engineer control for standard APIs. Like now I have to inquiry, so I am ready to discover the documentation at - https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_query.htm

Programming interface adaptations are ceaselessly overhauled, I am utilizing v42.0 and a basic inquiry for example SELECT Name, Type FROM Account. This will be a GET demand and in the header, I'll set the key:- Authorization and Value:- Bearer as we have the entrance token kind of carrier (from the past JSON reaction).

The URL I will hit is:- https://ap5.salesforce.com/administrations/information/v42.0/inquiry/?q=SELECT+Name,Type+FROM+Account

dont miss out iconCheck out another amazing blog by Aditya here: Multipart/form-Data in Salesforce Integration | The Developer Guide

In this way, we have the last solicitation and reaction on clicking Send as given beneath:-

Salesforce API

Responses

Popular Salesforce Blogs