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
- Once you have downloaded or created a fork from Github, see the link to the video tutorials at the bottom of this article
- Go to your SOAP Login Endpoint
- 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
- 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.
- 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.
- Use the Salesforce APIs Collection with the Postman App | Developer Quick Takes: To learn how by clicking on Philippe's Youtube video on this link
- Explore the Salesforce API Collection: To learn how, click on the Philippe's Youtube Tutorial
Hope you enjoy it!!!
Thank you for that!!