Push Data
Trigger Transfer
To push data, first initiate a transfer using the POST api/push/transfer endpoint.
Specify the session_id
of the session you are using, and the endgrate_type
you are pushing out.
Transfer Data
The transfer_data
should be a list of nested objects with the following attributes:
IDs
id
is the unique identifier for this resource returned by an integration provider. For example, this could be a HubSpot contact ID or a Quickbooks invoice ID. Specify this if you are updating an existing record. Endgrate will return theid
of a created resource when you query for returned data.internal_id
is your own unique identifier for this resource. For example, this could be your own app's contact ID for the resource or your own app's invoice ID for the resource. This is useful if you don't want to keep track of returnedid
s. Endgrate will automatically use your owninternal_id
instead ofid
to keep track of when to update existing resources.
Data
The data you want to push should be in accordance with your schema and specified in the data
attribute.
Associations
Endgrate supports pushing associated resource data. To do so, specify associated transfer data keyed by their endgrate_type
in the associations
attribute. Note that these endgrate_type
s must exist in your session.
curl --request POST \
--url https://endgrate.com/api/push/transfer \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"endgrate_type": "crm-contact",
"session_id": "6566e85e7cf20dca9cef0c0a",
"transfer_data": [
{
// This is the contact data I'm pushing out, conforming to the standardized schema for contacts I set up in the session.
"data": {
"first_name": "Bob",
"last_name": "Smith"
},
"associations": {
"crm-company": [
{
// This is the associated company data I'm pushing out, conforming to the standardized schema for companies I set up in the session.
"data": {
"name": "Acme Corporation"
},
// This is the internal ID of the company associated to the contact I'm pushing out.
"internal_id": "Company1"
},
// This is another company I'm associating with this contact.
{
"data": {
"name": "Bacme Corporation"
},
"internal_id": "Company2"
}
]
},
// This is the internal ID of the contact I'm pushing out.
"internal_id": "Contact1"
},
// This is another contact I'm pushing out.
{
"data": {
"first_name": "David",
"last_name": "Jones"
},
"associations": {
"crm-company": [
{
"data": {
"name": "C Inc."
},
"internal_id": "Company3"
}
]
},
"internal_id": "Contact2"
}
]
}
'
Upsert
By default, Endgrate automatically attempts to upsert data for certain endgrate_type
s:
crm-contact
: upsert based on email, phone, and full name.crm-company
: upsert based on domain and full name.
To disable this, set the disable_upsert
flag.
Get Returned Data
To get returned data, call the GET api/push/data endpoint once the transfer is completed. In the order that transfer data was pushed, you'll receive back the corresponding id
of the resource and the data
returned by the integration provider.
Alternatively, you can specify a data webhook when initiating a push transfer. After the data gets pushed, we will return the data provided by the API to the endpoint you provide. For more information on the error webhook visit webhook options.
Note
- Some integration providers do not support returning data, so the
data
attribute will be an empty object{}
.- If you initiated a push + pull session, Endgrate will transform the
data
returned into your standardized schema format. Otherwise, Endgrate will return the rawdata
.
Get Completed Message
To get a completion notice sent to your API you can specify the completed_webhook when initiating a push transfer. A completion notice will automatically get sent whenever all the data finishes transferring. For more information on the completed webhook visit webhook options.
Get Error Message
To get error messages sent to your API you can specify the error_webhook when initiating a push transfer. Whenever an error occurs during the transfer process, we will automatically post data to the webhook you specify with your metadata. For more information on the error webhook visit webhook options.
Updated about 2 months ago