function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Fayaz MD 3Fayaz MD 3 

REST api account creation

Hi ,
While creating account,  what  are the parameters to be passed in request with REST api. 
DevADSDevADS
Hi Fayaz,

You've to pass the Endpoint, Authorization token & the body to create an account record. Do let me know if you need further help.

Post steps here which you are following.

Happy Coding!
Fayaz MD 3Fayaz MD 3
Thanks,

I am creating by account with details but I want to know what are the parameters in  body . Like keys in JSON body ? 

Ex :
{
"Name"  : "Test account Name" 
}

Write know  I am using this to create account it is creating but I want to know like other fields that I can pass. 
Raj VakatiRaj Vakati
You can pass any field that you have access like below 
 
{
"Name"  : "Test account Name" ,
"Rating":"hot",
"Type":"Customer"
}

 
DevADSDevADS
As Raj mentioned, You can pass a JSON body in the POST request.

Refer below structure for JSON body with Standard & Custom fields -
{
    "Active__c":"No",
    "Name":"Test Account ",
}

Happy Coding!
 
Fayaz MD 3Fayaz MD 3
Thanks. While creating contact if I pass the account id that I got from salesforce then it will map to contact on on salesforce right ? Best regards, Fayaz Systems Analyst - SD, Value Labs - 'inspired by potential' Mobile: +91-7799411779
DevADSDevADS
Yes, that is correct understanding!

If you are posting request from the any 3rd party database then you can create a unique external id field which will map the appropriate account with contact. The External id field on the account needs to be mapped with primary key of the 3rd party database.
If you are doing it in Salesforce then you can directly map it with SF id.

Hit "Best answer" whichever comment helped you to answer your question.