Data transit using Workbench

Sharing is caring!

Tool Used: Workbench (https://workbench.developerforce.com/login.php?startUrl=%2FrestExplorer.php).

Tool Description: Workbench is a suite of tools that facilitates interactions with Salesforce org through the Application programming interface (API).  There are plenty of tools available for you to use when it comes to making REST requests from any HTTP sender (for example, check out cURL or Postman). However, Workbench provides a friendly framework specifically for Salesforce APIs and therefore it is the perfect way to dig in before you’re ready to write a full-on integration.

Steps for working with Workbench: Following are the points to make API request via Workbench:

  1. Go to the link: https://workbench.developerforce.com/login.php?startUrl=%2FrestExplorer.php
  2. Select the desired environment and API version and then proceed to select the agreement.
  3. Log in with your Salesforce credentials.
  1. The text in the text box represents a resource Uniform Resource Identifier (URI, only a part of it gets displayed). The radio buttons above the URI represent the standard HTTP methods. To make an API call, we will have to enter the resource URI, select the appropriate method, add headers as needed, and then click on Execute.

Example: Using the GET method to fetch metadata about an object and its fields.

  1. Paste this URI in box: /services/data/v46.0/sobjects/account/describe:
  • /services/data—Specifies that we’re making a REST API request
  • /v46.0—API version number
  • /sobjects—Specifies that we’re accessing a resource under the sObject grouping
  • /account—sObject being actioned; in this case, account
  • /describe—Action; in this case, a describe request
  1. Now make sure that the GET method is selected, and click Execute.

  3. The Account metadata appears on the screen (in a formatted form). Click Show Raw Response.

  1. To view response in XML:  replace application/json with application/xml in header.

Additional Points: 

  1. One can use other HTTP method to achieve different goals.
  2. For example, use POST method to create a record of any object type.
Suraj

Suraj Tripathi

Salesforce Consultant | Solutions Engineering Head
"Suraj Tripathi, a certified Salesforce Principal Consultant of repute, is a wonderful mentor and leader. A certified Salesforce Architect and a 7x Salesforce Certified Platform Application Developer by passion and profession, Suraj has rich experience in languages such as Aura, HTML, Angular, Bootstrap, APEX, and JavaScript. With more than five years of expertise in Salesforce Development, Suraj has worked on more than 50+ projects out of which 20+ projects were related to Salesforce Integration, Writing Triggers, Batch classes, VisualForce pages, and Aura Components.

Hire the best Salesforce Development Company. Choose certified Salesforce Developers from Cloud Analogy now.

This Post Has 2 Comments

    1. Cloudanalogycrm

      Hey Claudia, Thanks for your kind words. We’re glad you found our content informative and helpful, and we look forward to sharing more with you.
      Keep reading 🙂

Leave a Reply

× How can I help you?