ONE DAY SALE

Free Salesforce Developers Tutorials >

Chapter 13 - API >

REST API Part 2

REST API Part 2

What You’ll Learn


S2 Labs

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:

  1. Login to workbench: https://workbench.developerforce.com/login.php, with your salesforce org.
  2. Then, In Utilities, click on Rest Explorer.
  3. 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.
  4. 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:

  1. Install Postman or open Postman in the browser.
  2. Register and log in to Postman.
  3. In Workspaces, Click on My Workspace.
  4. Click on the + icon, to create a request tab.
  5. Paste your endpoint and select the method, and enter the headers, body, or param.
  6. Click on send button.
Note:

Whole practical implementation of using a Postman is shown in the video.

salesforce-developer

Download Study Material

Get access to exclusive study material for Salesforce Certification and ace your exams!

Download Now

Our Salesforce Certification Courses

Hey there! Glad you made it through our Salesforce Developer Training for beginners . But wait! We've got some high-in-demand Salesforce courses for you to take your Salesforce skills to the next level, making you a desired professional in the Salesforce job market.

Post a Comment

Your email address will not be published. Required fields are marked *