Salesforce REST API Integrations using Postman

To Login into Salesforce Org 

Use user credentials below for Salesforce login.   

  • Sandbox URL : <<URL of the Salesforce Org>> 
  • Username :<<Username of the org credential> LPassword : <<Password of the User>> 
  • Security Token : <<Security token of the User>> 

To Create Connected App 

A Connected App is needed in Salesforce to authorize external systems using OAuth 2.0.  

Please refer below URL for more details. 

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_oauth_and_connected_apps.htm

or follow-up below steps 

  1. Switch over to Lightning Experience 
  1. From the Setup -> quick find the “App Manager” and click on it 
  1. Click “New Connected Apps” from the Top corner button. 
  1. Fill in the required fields: 
  • Selected OAuth Scope: select all the available option 
  • Click Save button 
  • Click Continue button 
  1. Once created new connected app, you can get client Id and client Secret Id. Refer screen short 
  • Consumer Key:  3MVG9NYvTkhtdEI7DTI9FlgDxG04BVxJi2SI04QRWB8XjHLZdbxvGXZsnAkc2hsmOZpCw6Ogl4TJ3uVdOTUY6 
  • Consumer Secret: F9B4860783ECA84F27CD71362C06472D3B68A736CF225C4EEB016E13D28CAEE1 

Once created new connected app, you can get client Id and client secret Id. As mentioned in screenshot 

Connecting to Salesforce REST APIs Postman client  

Below are the steps to authorize and test Salesforce REST API using Postman tool. 

  

To authorize Salesforce Org from Postman. Setting up the HTTP login request URL  

  1. Launch Postman 
  1. Create a new request. Use https://labelbox.my.salesforce.com/services/apexrest/SFOrganizationIntegrationService in the URL box for Sandbox connection.  
  1. Choose POST method since it is a POST request to get access__token for Salesforce Org.  
  1. Click the “Authorization” option and choose the “OAuth 2.0”   
  1. Choose Add Authorization data to “Request Header”   
  1. Fill in the details below “Configuration new Details”  
  • Token Name – Any suitable name (For example: SF Token)  
  • Client Secret – Your Client Secret  
  • Scope – Optional leave blank  
  • State – Optional  
  • Client Authentication – Select Send Client Authentication in body and click on Request token 
  1. Click “Access Authorization” 
  1. It will redirect to Salesforce login page.  
  1. Provide Salesforce credentials and click allow   
  1. Once access is completed, Authentication completed will show.  
  1. Go to postman page and you can get popup window, click get “access token”   
  1. Click “use token” from postman.  
  1. A new token will appear.  

GET Request: Test Custom Rest API using Postman to get Organization & Add-Ons details.  

  1. Set HTTP Method should be “GET” and give the access URL https://sample.my.salesforce.com/services/apexrest/SFOrganizationGetAddOnService/<<OrgId>  (custom domain should be your domain)  
  1. Click Send button and the response is 

Sample Output  

  

{  

    “Tier”: “<<Name of the default entitlement record>>”,  

    “orgId”: “<<Organization Id>>”,  

    “message”: “Organization found in Salesforce.”,  

    “addOns”: [  

        {  

            “Quantity”: <<quantity number>>,  

            “addOnName”: “<<Add-On Name>>”  

        },  

        {  

            “Quantity”: <<quantity number>>,  

            “addOnName”: “<<Add-On Name>>”  

        },  

        {  

            “Quantity”: <<quantity number>>,  

            “addOnName”: “<<Add-On Name>>”  

        },  

        {  

            “Quantity”: <<quantity number>>,  

            “addOnName”: “<<Add-On Name>>”  

        }  

    ]  

}  

  

POST Request:Test Custom Rest API using Postman to create Organization in Salesforce.  

  1. Use URL: https://sample.my.salesforce.com/services/apexrest/SFOrganizationIntegrationService  
  1. Add Input JSON Payload as mentioned below.  
  1. Check the raw and choose data type should be JSON  

Sample Input request  

{  

    ”orgId” : ”<<Organization Id>>”,  

    ”orgName” : ”<<Organization Name>>”,  

    ”orgUserId” : ”<<Organization User Id>>”,  

    ”orgUserEmail” : ”<<Organization User Email>>”  

}  

  

Sample Output response  

  

{  

    ”responseType”: ”success”,  

    ”orgSFId”: ”<<SF Id of the Organization Record>>”,  

    ”orgId”: ”<<Organization Id>>”,  

    ”message”: ”Organization record created/updated successfully.”  

}  

About MST

At MST Solutions our cornerstone is to adapt, engage and create solutions which guarantee the success of our clients. The talent of our team and experiences in varied business verticals gives us an advantage over other competitors.

Recent Articles

Work with us.

Our people aren’t just employees, they are key to the success of our business. We recognize the strengths of each individual and allow them time and resources to further develop those skills, crafting a culture of leaders who are passionate about where they are going within our organization.