Salesforce REST APIs
AgentSync is built on the Salesforce platform and allows for a variety of integration patterns. If you prefer to use a REST API for your integration, Salesforce provides a robust and well-documented REST API. We have outlined some key details about how to manage AgentSync data using the Salesforce REST API. We recommend reviewing the extensive developer documentation that is available here.
Authorization¶
We will configure a connected app within the AgentSync application and configure a service user within your account. Once you have received your credential details, you can authorize your application using one of the supported OAuth Authorization flows.
Working with Data¶
Any data available on the AgentSync application is also available via API. Detailed information about how to work with data including examples are here. All calls require an authorized access token obtained through a supported OAuth Authorization flow.
AgentSync Data Dictionary¶
Please review the AgentSync Data Dictionary for specific information about the Salesforce API names for AgentSync Objects and Fields. Contact us to get a link to the latest Data Dictionary.
Other Resources¶
The Integration and APIs Developer Center has a wealth of knowledge about the various integration options on the Salesforce platform.
We also recommend leveraging the expansive Salesforce Developer Community through the Developer Forum for help on specific development questions.
Examples¶
Insert an account¶
Sample curl request
curl <https://yourInstance.salesforce.com/services/data/v52.0/sobjects/Account/> \
-H 'Authorization: Bearer token' -H 'Content-Type: application/json' \
-X POST -d '{ "Name": "ABC Agency", "agentsync\_\_NPN\_\_c": "110000” }
Sample success response
Insert a contact¶
Sample curl request
curl <https://yourInstance.salesforce.com/services/data/v52.0/sobjects/Contact/> \
-H 'Authorization: Bearer token' -H 'Content-Type: application/json' \
-X POST -d '{ "FirstName": "Secret", "LastName": "Agent", "AccountId": "001D000000IqhSLIAZ", "agentsync\_\_NPN\_\_c": "220000” }
Sample success response
Retrieve an account¶
Sample curl request
curl <https://yourInstance.salesforce.com/services/data/v52.0/sobjects/Account/001D000000IqhSLIAZ?fields=Name>,agentsync\_\_NPN\_\_c,agentsync\_\_ID\_FEIN\_\_c, agentsync\_\_STATE\_DOMICILE\_\_c \
-H 'Authorization: Bearer token'
Sample success response
{ "Name" : "ABC Agency", "agentsync\_\_NPN\_\_c" : "110000", "agentsync\_\_ID\_FEIN\_\_c" : "1234", "agentsync\_\_STATE\_DOMICILE\_\_c" : "CA", }
Retrieve a contact¶
Sample curl request
curl <https://yourInstance.salesforce.com/services/data/v52.0/sobjects/Contact/003D000000IqhSLIAZ?fields=FirstName>,LastName,agentsync\_\_NPN\_\_c,agentsync\_\_DATE\_BIRTH\_\_c \
-H 'Authorization: Bearer token'
Sample success response
{ "FirstName" : "Secret", "LastName" : "Agent", "agentsync\_\_NPN\_\_c" : "220000", "agentsync\_\_DATE\_BIRTH\_\_c" : "1958-10-13" }
Update an account¶
Sample curl request
curl <https://yourInstance.salesforce.com/services/data/v52.0/sobjects/Account/001D000000IqhSLIAZ> \
-H 'Authorization: Bearer token' -H 'Content-Type: application/json' \
-X PATCH -d '{ "Name": "BCD Agency" }
This call returns an empty response body.
Update a contact¶
Sample curl request
curl <https://yourInstance.salesforce.com/services/data/v52.0/sobjects/Contact/003D000000IqhSLIAZ> \
-H 'Authorization: Bearer token' -H 'Content-Type: application/json' \
-X PATCH -d '{ "FirstName": "Test" }
This call returns an empty response body.