This article describes "Username-Password OAuth flow" testing using POSTMAN
It's just 2 step process.
STEP 1: Getting Access Token(aka SessionId)
1. URL: https://login.salesforce.com/services/oauth2/token
2. Click on BODY
3. Choose "form-data"
4.Key value pairs as below
KEY Value
username org2@salesforce.com
password 9989008211a
grant_type password
client_id 3MVG9d8..z.hDcPK1
client_secret B2B9A3A6841E77
5. Click on "send" button, you will receive the "Access Token".
STEP 2: Creating a record using the POST method
URL: https://integrationorg-dev-ed.my.salesforce.com/services/data/v43.0/sobjects/Account/
Header:
------
Key : Authorization
Value : Bearer 00D7F000005lVFt!AQQA
Key : Content-Type
Value : application/json
Body:(choose "Raw")
------------------
{
"Name" : "hello REST POST call"
}
Possible errors:
tHiNk gooD and dO thE bEsT.........MANJU NATH 🌝
{
"error": "unsupported_grant_type",
"error_description": "grant type not supported"
}
1. a. In Step 1, If URL is "HTTP" instead of "HTTPS" (Or)
b. You might be passing the credentials in Header instead of Body.(or)
c. For Password, value should be "Password+SecurityToken".
2. In Step 2, If URL is "HTTP" instead of "HTTPS"
[
{
"message": "HTTPS Required",
"errorCode": "UNSUPPORTED_CLIENT"
}
]
3.In Step 2, If URL is "https://login.salesforce.com/services/data/v43.0/sobjects/Account/" instead of " https://integrationorg-dev-ed.my.salesforce.com/services/data/v43.0/sobjects/Account/"
[
{
"errorCode": "URL_NOT_RESET",
"message": "Destination URL not reset. The URL returned from login must be set"
}
]



Comments
Post a Comment