Pre-Request Script with Postman and Salesforce
Logos by Postman and Salesforce

Pre-Request Script with Postman and Salesforce

Hey everyone, just sharing this quick article on how I use the pre-request script in Postman to speed up access to a developer's org. For more complete details on how to use the Salesforce Postman Collection, I have inserted links with tutorials created by the Salesforce Team below, more specifically by Philippe Ozil, the Principal Developer Advocate at Salesforce.

I understand that this type of connection is not everyone's favorite method of exploring Salesforce, however, for those out there who are keen users of Postman as I am, this little tip on setting up your pre-request script to auto-complete your Salesforce Environment Variables, with your Org and user credentials, can be a time saver.

Note: For each Dev org, my recommendation is to duplicate the collection, this way you avoid changing and trying to find your credentials every time for different orgs.

Instructions

  1. Once you have downloaded or created a fork from Github, see the link to the video tutorials at the bottom of this article
  2. Go to your SOAP Login Endpoint
  3. Click under the pre-request script and insert the following: Version + clientSecret = YourConsumerSecret + clientId = YourConsumerKey + url = Salesforce login URL or your custom domain endpoint + username = The username you use on your org + password = as it says, your password :) + secretToken = This a token that usually sent to your email. See this discussion for more details
No alt text provided for this image
  1. Make sure you have a Salesforce Environment. Note, do not use the original environment found in the Salesforce Collection, instead, duplicate it with a different name.
  2. Done. With this setup, you will avoid having to set this up under the environment and the pre-request script will handle the heavy load of saving it once you send this request.

For more resources, watch the Salesforce + Postman Tutorials by Philippe Ozil

Philippe Ozil, the Principal Developer Advocate at Salesforce, created a few amazing Youtube videos where you can follow along and learn how to connect and create a fork to the Salesforce and Postman API collection on Github.

No alt text provided for this image

Hope you enjoy it!!!





To view or add a comment, sign in

Others also viewed

Explore content categories