Retrieving Contacts
Contacts can be retrieved both via contactId, as well as email.
Note that email is not a primary identifier, and it's possible that multiple contacts have the same email - so querying on email returns a list. ID will always return one entry (if the contact exists).
Single (Query by ID)
GET https://driftapi.com/contacts/{contactId}
Multiple (Query by Email)
GET https://driftapi.com/contacts
Accepted Query Parameters:
email
filters out contacts where the email does not matchlimit
sets a max for the number of contacts returned
ex: GET https://driftapi.com/[email protected]
response-success:
Headers: Link: "<link>; rel='next'"
{
"data": {
"id": 1234567890,
"createdAt": 1617825403810,
"attributes": {
"original_ip": "45.42.45.124,52.89.138.153",
"_END_USER_VERSION": 87,
"_end_user_version": 87,
"recent_entrance_page_url": "http://www.yoursite.com",
"recent_entrance_page_title": "Your Website",
"_calculated_version": 87,
"ip": "45.42.45.124,52.89.138.153",
"externalId": "a12-1234",
"tags": [],
"original_entrance_page_url": "http://www.yoursite.com",
"original_entrance_page_title": "Your Website",
"socialProfiles": {},
"last_active": 1617826661680,
"first_name": "Bruce Wayne",
"email": "[email protected]",
"events": {},
"start_date": 1617825403810
}
}
}
Retrieving contacts by external id (your identifier)
If you identified a contact with a custom identifier, use the following syntax to retrieve a contact by that ID, replacing
USER-143
with your ID value. You can also provide multipleid
query params if you want to retrieve multiple contacts at once in a single request.
https://driftapi.com/contacts?idType=external&id=USER-143
Updated over 3 years ago