REST API Part 2
Chapter Topics
- APIs in Salesforce
- Need of API in Salesforce
- Languages Used in creating APIs
- How Communication Happens in APIs
- Types of APIs in Salesforce
- REST API Part 1
- REST API Part 2
- REST API Part 3
- REST API Part 4
- REST API Part 5
- REST API Part 6
- REST API Part 7
- REST API Part 8
- REST API Part 9
- SOAP API Part 1
- SOAP API Part 2
- SOAP API Part 3
- SOAP API Part 4
- SOAP API Part 5
- Metadata API in Salesforce
What Is Workbench In Salesforce?
A workbench is a tool that is mainly used to test APIs created in Salesforce. It also consists of various other features like querying data, bulk API calls, making DML operations and migrating data(deploying and retrieving), etc.
How To Use A Workbench?
You just have to go to the workbench site. Log in with your salesforce org. Then you can start using Workbench.
Note: Whole practical implementation of using a workbench is shown in the video.
Calling Salesforce REST API From Workbench
To call API from API from Postman:
- Login to workbench: https://workbench.developerforce.com/login.php, with your salesforce org.
- Then, In Utilities, click on Rest Explorer.
- Finally, Select the HTTP method, and enter the rest of the URL path in the input, enter the body(if any) in the body input.
- Click on Execute button.
How To Access The Request Body In Salesforce?
The following code is used to access the request body in Salesforce:
RestRequest req = RestContext.request;
String body = req.requestBody.toString();
What Is Postman?
Other than Workbench, There is another most used only API testing tool that is Postman. The difference between Postman and Workbench is their features. Postman can be used for any kind of API not only Salesforce API.
How To Call API From Postman?
To call an API from Postman:
- Install Postman or open Postman in the browser.
- Register and log in to Postman.
- In Workspaces, Click on My Workspace.
- Click on the + icon, to create a request tab.
- Paste your endpoint and select the method, and enter the headers, body, or param.
- Click on send button.
Note:
Whole practical implementation of using a Postman is shown in the video.
Join our newsletter: Get daily update on Salesforce career insights & news!
Join Now!
Need more support?
Get a head start with our FREE study notes!
Learn more and get all the answers you need at zero cost. Improve your skills using our detailed notes prepared by industry experts to help you excel.