How to Create, Update, Delete Record And Query in Postman Using REST API

July 08, 2023


 

In this blog we will discuss how to create, update, delete, query and queryAll the records using rest api through postman.

After completing this blog, you’ll be able to:

 

 

Get Access Token in Postman like this:

To get Access Token you need to create the first Connected App in Salesforce ORG then you can find client Id and client secret there.

1.1 Paste the below URL in postman set method GET 

1.2 Click on Send Button

URL: https://login.salesforce.com/services/oauth2/token?client_id={Your_Client_ID}&username={UserName}&password={password}&grant_type=password&client_secret={your_client_secret}

Here:

  1. Client_id = Your client Id
  2. Username = Your Salesforce org username 
  3. Password = Your Salesforce org password
  4. grant_type = password
  5. Client_secret = Your Client Secret

 

 

 

Create Record Using REST API

URL:  {{_endpoint}}/services/data/v{{version}}/ui-api/records

Here:

Body:

{

    "allowSaveOnDuplicate": false,

    "apiName": "Account",

    "fields": {

        "Name": "TestDemoAccount1"

    }

}

 

 

 

Update Record Using REST API

URL{{_endpoint}}/services/data/v{{version}}/ui-api/records/{{record_id}}

Body: 

{

    "allowSaveOnDuplicate": false,

    "fields": {

        "Name": "TestDemoAccount"

    }

}

 

Here:

 

 

 

 

Delete Record Using REST API

URL:  {{_endpoint}}/services/data/v{{version}}/ui-api/records/{{record_id}}

Here:

 

 

 

 

Query Record Using REST API

URL:  {{_endpoint}}/services/data/v{{version}}/query/?q=SELECT FIELDS(All) FROM EventLogFile LIMIT 200

Here:

 

 

 

 

QueryAll Record Using REST API

URL:  {{_endpoint}}/services/data/v{{version}}/queryAll/?q=SELECT+name+from+Account

Here: 

 

 

 

I hope this blog helped you!