Introduction
From here on, this document uses https://example.com/api/odyssey/ as the example base URL
This document describes a specification for a generic API that exposes clickstream data about converted customer journeys. If your API follows this spec, you can create an Odyssey account which uses the data your API exposes.
A Swagger specification of this document is also available in both JSON and YAML formats.
Authorization
# Switch the language above to see an example of how to validate Odyssey requests in your API
export KEY = 'kqvtKkut8l50IKHBOYuWAS8G1MCgWqLuNZV0fKua'
To make sure only Odyssey can access your data, all requests to your API will be signed with a pre-shared key. When an agency sets up a new account in the Odyssey dashboard, they enter this key.
In your API, you should verify that Odyssey sent a correct signature.
The signature is created by taking the HMAC SHA256 of the full request URI.
In the case of the GET /data/{day}
call, the message might be https://example.com/api/odyssey/data/2017-01-01
.
Odyssey sends the signature in HTTP header X-Odyssey-Signature
.
Customer journeys
List journeys for all customers that have converted on a certain day
SIG = 'fdc3f7469d511293ce1b18643718963658cc86eecb9e2aae8633ff69c737db8f'
curl -H "X-Odyssey-Signature: $SIG" https://example.com/api/odyssey/data/2017-01-01
HTTP Request
GET /data/{day}
Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
day | path | Date where paths have been converted, in Y-m-d. | Yes | date |
Response
The endpoint should return JSON that follows this format:
[
{
"transactionId": "as3da64234dada",
"date": "2017-06-18",
"transactionRevenue": 199.12,
"events": [
{
"step": 1,
"eventTime": 1497793010,
"trafficSource": "Source",
"channel": "Referring sites"
}
]
}
]
Description
Code | Description |
---|---|
200 | successful operation |
404 | no conversions on this date |
When there is no data available for the given date, you can also return an empty array.
Conversion
Name | Type | Description |
---|---|---|
transactionId | string | The unique identifier of the translation |
date | string | The date the conversion has been converted, in Y-m-d |
transactionRevenue | double | The revenue generated by the conversion |
events | array | Array of events, see Event |
Event
Name | Type | Description |
---|---|---|
step | string | Increments for every event in conversion, the first event in an conversion should have step 1 |
eventTime | int | Timestamp for the start of the event |
trafficSource | string | The traffic source where the event originated from |
channel | string | The channel group the traffic source is associated with |
Errors
Your API can return the following error codes:
Error Code | Meaning |
---|---|
401 | Unauthorized – The given signature is incorrect. |
404 | Not Found – Data could not be found. |
429 | Too Many Requests – Odyssey is sending too many requests. We’ll use an incremental back-off strategy and try again later. |
500 | Internal Server Error – Your server is having issues. Odyssey will immediately stop trying to connect and mark the data collection as failed. |