Sending retailer events to the Driftrock Events API
Using the Driftrock Events API, you can pass events and actions to the Driftrock system, from your own lead management platform. This allows you to update records within Driftrock in real time, through an automated process.
Building the POST request
You can make POST requests to these URLs:
If you are sending to a Driftrock Webhook capture please use https://external-apis.driftrock.com/v2/event
Headers:
Content-Type: application/json
Accept: application/json
Authorization: Bearer xxxx-xxxx-xxxx-xxxx
Where xxxx-xxxx-xxxx-xxxx is an api key that you can obtain by going to Settings -> Security. You can use a previously created key or create a new one.
Body:
The body must be JSON formatted and containing the required or recommended fields:
event_type [string] (required) : this should be set to lead, conversion or action.
event_name [string] (required) : tell us what label you would like to assign to this event (eg: User signed up, Page view, Purchase )
source_id [string] (required) : this is needed to link the event to the Capture that you created. You can find this on the 'Connect' step (step 2) of your capture
fields [json] (required) : this is a json field, where you send us the attributes of this event (eg: "fields": {"email": "test@driftrock.com", "question_1": "test answer"} )
event_id [string] (optional) : this can be any ID that is used in your system to uniquely identify this event. Note that if you send two events with the same event_id, they will be linked to the same person in our system.
person_id [string] (optional) : this can be any ID that is used in your system to uniquely identify a person. Note that if you send two events with the same person_id, they will be linked to the same person in our system.
created_at [string] (optional) : if you would like to provide a more precise timestamp for when the event occurred. If not provided it will be set to the moment Driftrock receives the event, this is a subtle distinction but may be important to your business case. This should be passed in ISO8601 format, (eg: 2019-12-02T10:00:00.000Z)
Here's an example of what a simple body would look like
{
"event_type": "action",
"event_name": "Test Drive",
"source_id": "034feb07-0cd7-4d44-bbdb-ae18a8a4132f",
"fields": {
"email": "test@driftrock.com",
"first_name": "First name",
"last_name": "Last name",
...
}
}
Sending your first test lead
If your test has been successful, you should see the following response:
status: 200
payload: {"data": "ok"}
If your test failed, you will see the following response:
status: 400
payload: {"error": "..."}

