Hi, I've been through that documentation back and forth.. but I cannot find this particular endpoint/functionality reference. Would you mind pointing me where it might be? Thanks Pavel
Are you talking about a Contact endpoint specifically, or just this type of curl command? The Examples section has similar commands for Creating (POSTing) and Updating (PATCHing) an Account.
To add Contacts in Salesforce via REST API, you'll typically perform a POST request to the /services/data/vXX.0/sobjects/Contact/ endpoint with the contact details in JSON format. For authentication, use OAuth2. If you prefer a simplified approach, you can use Skyvia's (https://skyvia.com/connectors/salesforce) cloud data platform to manage and automate this REST API interaction, reducing the need for manual coding
You would curl against the Contact endpoint
with the newcontact.json having the following content
[1] https://www.salesforce.com/us/developer/docs/api_rest/
Thanks
Pavel
Are you talking about a Contact endpoint specifically, or just this type of curl command? The Examples section has similar commands for Creating (POSTing) and Updating (PATCHing) an Account.
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm)
you have to pass access token as a input.
const getContact = async (accessToken) => {
console.log('Retrieving a contact from HubSpot using an access token');
try {
const headers = await {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json'
};
const result = await request.get('https://na1.salesforce.com/services/data/v20.0/sobjects/Contact/',
{
headers: headers
});
const data = JSON.parse(result);
console.log(data);
return Promise.resolve(data);
} catch (e) {
console.error(' > Unable to retrieve contact');
return Promise.reject(data);
}
};
getContact(access_token);
Thanks
Abhishekh Kumar