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.
Whole practical implementation of using a Postman is shown in the video.