Make REST API Calls with Salesforce Inspector Extension

The blog post discusses the Salesforce Inspector Extension, a tool that aids in executing REST API calls within Salesforce. This extension enhances workflow and makes API interaction more efficient. Steps to make API calls, creating, updating, deleting accounts are explained in detail.

In this blog post, we will explore the Salesforce Inspector Extension, a powerful tool that facilitates the process of making REST API calls within the Salesforce environment. Whether you’re a seasoned Salesforce developer or just starting with the platform, this extension can significantly enhance your workflow and streamline your API interactions.

Advertisements

1. Click on the extension icon

2. Open your browser’s F12 Developer Tools and select the Console tab to make your own API calls.

3. Execute the code in console ( copy & paste the code and hit enter )

GET ACCOUNTS

display(sfConn.rest("/services/data/v56.0/query/?q=" + encodeURIComponent("select Id, Name from Account ")));
display(sfConn.rest("/services/data/v56.0/query/?q=" + encodeURIComponent("select Id, Name from Account where CreatedDate = THIS_YEAR")));

CREATE A NEW ACCOUNT

var myNewAccount = {Name: "Techno HUB"};

display(sfConn.rest("/services/data/v56.0/sobjects/Account", {method: "POST", body: myNewAccount}));

UPDATE ACCOUNT

var accUpdates = {"Name":"Test1001", "Phone":"1234567890"};

display(sfConn.rest("/services/data/v56.0/sobjects/Account/0015j00001Sx75XAAR", {method: "PATCH", body: accUpdates}));

DELETE ACCOUNT

display(sfConn.rest("/services/data/v56.0/sobjects/Account/0015j00001SwaARAAZ", {method: "DELETE"}));
Advertisements

About the blog

SFDCLessons is a blog where you can find various Salesforce tutorials and tips that we have written to help beginners and experienced developers alike. we also share my experience and knowledge on Salesforce best practices, troubleshooting, and optimization. Don’t forget to follow us on:

Newsletter

Subscribe to our email newsletter to be notified when a new post is published.

Advertisements
Arun Kumar
Arun Kumar

Arun Kumar is a Salesforce Certified Platform Developer I with over 7+ years of experience working on the Salesforce platform. He specializes in developing custom applications, integrations, and reports to help customers streamline their business processes. Arun is passionate about helping businesses leverage the power of Salesforce to achieve their goals.

Articles: 162

Leave a Reply

Discover more from SFDC Lessons

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from SFDC Lessons

Subscribe now to keep reading and get access to the full archive.

Continue reading