Salesforce - Postman connection (integration)

Salesforce - Postman


In order to connect Salesforce and Postman, all you need are three things :

1. Install Postman or sign-in to postman
2. Create an connected app in Salesforce
3. Apex class exposed to Postman for accessing data from Salesforce

Apex Class : (simple class to return a "String")

@RestResource(urlMapping='/getStrings/*')
global class postmanConnectorService {
    @HttpGet
    global static String stringFetch(){
            return 'I am a string and i am being fetched from Salesforce Organization';
    }

} 


Creating an connected app in Salesforce : (Steps to follow)






After installing or sign-in to Postman : (follow the below steps)

Prepare ur url in the below format, replace all the yellow with the required inputs

URL 1 : https://test.salesforce.com/services/oauth2/token?grant_type=password&client_id=ConsumerKey&client_secret=ConsumerSecret&username=UserName&password=Password&redirect_uri=https://login.salesforce.com/services/oauth2/success


URL 1, is used for fetching the access token, this is necessary to connect with Salesforce to prove that you are an authenticated external system trying to access . 


Use POST method to get the access token, use the same access token to GET the string from exposed apex class.






If at all you get 401 - invalid header, it means that you do not have access to Salesforce.
If at all you get 400 - invalid_grant, it means that you do not have provided proper Urls or credentials are wrong to Salesforce.

Salesforce - Postman connection (integration) Salesforce - Postman connection (integration) Reviewed by dasfrogpractice on 01:45 Rating: 5

1 comment:

  1. How to use Google Analytics in 2021 | JtmHub
    It is important 안산 출장안마 to find your complete information before 동해 출장샵 you create an account. We will tell you all about 거제 출장안마 the top 10 sportsbook apps 사천 출장마사지 to 김제 출장마사지 use.

    ReplyDelete

Theme images by mariusFM77. Powered by Blogger.
Youtube Channel Image
Dasfrog Subscribe To watch more Salesforce Training
Subscribe