Search code examples
salesforcesalesforce-lightningsalesforce-communities

SalesForce Create Lead Rest Api


My task is pretty simple, all i have to do is to create records in the lead section of the salesforce. I have created a free account and i am not able to figure it out that, what is https://yourinstance.saleforce.com in the below rest api:

https://yourinstance.salesforce.com/services/data/v39.0/sobjects/Lead

Body JSON:

{
    "body": {
    "Salutation": "Mr.",
    "FirstName": "H",
    "LastName": "Sam",
    "Company": "Samosto"
    }
}

Header:

Authorization: Bearer 00D0o0000015jPn!ARgAQPiIGhuYGUG_c0HDKNR0hxTX9zS82Fv1lIuqn4rapFJHPR422gLyi10rF8Auukb._hj9pj532DP7IajQV36lyKpUNEXdxvL

Content-Type: application/json

Sforce-Auto-Assign: TRUE

Any help will be highly appreciated!


Solution

  • This is the URL you have for the organization you want to login to. Since most of the orgs are using their own Domain names in guides or examples you will see this "https://yourinstance.saleforce.com" being used.

    You can simply take it from the URL while logged in Salesforce or go to Setup -> quick search "My Domain" and you will see the domain name. It is a good thing to check it from here as the generic URL can also be blocked as a login option.