Menu Close
    Hire us Request quote Reading list Switch to dark mode

    How to run REST API through Workbench Salesforce

    In this blog we will learn about how we can run REST API through Workbench to retrive, create, update or delete the data of our Salesforce org. Let us get started!

    Prerequisites

    1) Click on the link to open workbench: Workbench
    2) Log in to your Salesforce Org, and allow access.
    3) Go to Utilities > REST Explorer

    REST Explorer through Workbench

    When you open REST explorer, you will find the following by default:

    1) HTTP method set to Get.

    2) URI set to following:


    3) When you click on Headers button you will find that Request Headers is set to following code by default:


    Through the above header you can get JSON response. If you want to receive your response in XML format, set the below code in Request Headers


    Let us execute the default set URI. You’ll get the output as below:

    CRED operations using REST API

    Let us perform the CRED operations using REST API:

    >> CREATE:

    For creating records through REST API we use the /sobjects/ URI. Please make sure HTTP method is set to POST

    Step 1: Set the URI according to the object you want to insert.


    Step 2: Set the Request Body with fields and its values


    Step 3: Execute.

    You will get the following result:

    >> READ:

    We will perform READ operation through SOQL query using REST API.Please make sure that HTTP method is set to GET We have following resources for requesting SOQL query through REST API :

    1) /query : It returns all the records present in the org according to the query.


    2) /queryAll : It returns all the records present in the org, including the deleted records which are present in “recycle bin”, according to the query.

    >> EDIT:

    For editing/updating records through REST API we use the /sobjects/ URI. Please make sure HTTP method is set to PATCH

    Step 1: Set the URI according to the object you want to edit, and also mention the related Id.


    Step 2: Set the Request Body with fields and its values


    Step 3: Execute.

    You will get the following result:

    >> DELETE:

    For deleting records through REST API we use the /sobjects/ URI. Please make sure HTTP method is set to DELETE

    Step 1: Set the URI according to the object you want to delete, and also mention the related Id.


    Step 2: Execute.

    You will get the following result:

    Support

    That’s all for how to run REST API through Workbench, still have any issue feel free to add a ticket and let us know your views to make the code better https://webkul.uvdesk.com/en/customer/create-ticket/

     

    . . .

    Comment

    Add Your Comment

    Be the first to comment.

    Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just received your message and our expert will get back to you shortly.
    Send Again
    Close

    Table of Content

    Hide Index