Exporting event information with the Driftrock API

Edited

This guide explains the ways to get data out of Driftrock for use in spreadsheets, business intelligence (BI) tools, data warehouses and internal reports.

What data can be exported?

Driftrock records data as Events. There are two main types:

  • Leads: the first submission from a person, received through a Capture.

  • Actions: later activity linked to that person, such as a test drive, finance approval or order.

Each Action is linked back to the original lead, so it carries the same campaign, channel and source details.

Depending on the export method, you can access:

  • Vehicles

  • Events (leads and actions)

  • Captures

  • Opportunities

Documentation

The Driftrock API uses Swagger for documentation and OAuth for authentication.

Here is a Swagger file with further information:

Swagger / API docs - https://public-gateway.driftrock.com/docs

OAuth2 token endpoint: https://external-apis.driftrock.com/oauth2/token

Authentication

Access is authenticated using OAuth2, a standard method that allows one system to access another without sharing a username and password. Each OAuth App has separate credentials and scopes. To export from the URL you will need a Client ID and a Client Secret, as part of OAuth authentication.

Only Admin users can create or edit OAuth Apps, so an Admin must complete these steps. This includes turning on PII Access.

  1. Log in to Driftrock as an Admin and go to Security → OAuth Apps

  2. Create a new OAuth App and name it according to its purpose, for example "Power BI reporting".

  3. Click the edit icon and select the scopes the app requires, for example events_read.

  4. Turn on PII Access if personal data fields such as names, email addresses and phone numbers are required. It is off by default.

  5. Save the app and copy the Client ID and Client Secret. The Client Secret is shown once only.

  6. Enter the Client ID and Client Secret into the external system, with https://external-apis.driftrock.com/oauth2/token as the token URL.

PII Access

A separate flag on the OAuth App (disabled by default) governs whether personal-data fields (e.g. email, name) are included on endpoints like Events, this is independent of which scopes are granted

Using event data from the Driftrock API:

  • Every Event has an Event ID, which is unique to that single action.

  • Every Event has a Person ID, which is shared across all Events for the same person. Driftrock links records to one person using email, phone or a Driftrock ID. The Person ID applies across the whole account, not per location.

  • The API returns every Event, including repeat actions by the same person (for example, two test drives). These are separate, genuine Events.

  • To count people rather than Events, group the data by Person ID.

FAQs

Why don’t my API figures match what I see in the dashboard?
Figures will only match when you compare like with like. Make sure you’re using the same date range in both places and the same counting method (total or unique). Leave out the current day too: today’s data is still coming in, so it will always be incomplete.

Does the API return personal data?
It can. Both API responses and dashboard exports may include personal data, such as names and contact details. Please store and share any data you retrieve in line with your organisation’s data protection obligations.

Why are personal data fields missing from my API results?
This usually means PII Access isn’t turned on for the OAuth App you’re using. Check that setting on your OAuth App, and once it’s enabled, personal data fields will be included in the response.

Why is the API returning an empty list?
An empty list means there’s no data of that type on your account, rather than an error. For example, if you query a data type your account doesn’t collect, the API will return an empty list.

Was this article helpful?

Sorry about that! Care to tell us more?

Thanks for the feedback!

There was an issue submitting your feedback
Please check your connection and try again.