NAV Navbar
Example API return
  • Introduction
  • Authenticating your requests
  • Authentication
  • Invites
  • Users
  • Accounts
  • Publishers
  • Tours
  • Introduction

    Welcome to the Odyssey API documentation. This document gives you all the information you need to get started with getting analyzed data out of Odyssey.

    If you want to get your custom data into Odyssey, check out the custom data integration documentation.

    The base URI of the Odyssey API is https://api.odysseyattribution.co/api/.

    Authenticating your requests

    Authentication with the Odyssey API is done using bearer tokens in the Authorization API header.

    curl -H "Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXN0IjoidGhpcyBpcyBqdXN0IGFuIGV4YW1wbGUifQ.tRg7qdMaMa7HfLQi3TT8v0BaLiBpqdZz8ZkYLK023Rw" https://api.odysseyattribution.co/api/accounts/list
    

    To obtain a token, you can authenticate with the API using an email address and password (see below).

    Token expiration

    The bearer tokens used by the API can expire. If your token has expired, you will return a 419 status code from the API.

    In this case, you have two options:

    Token invalidation

    If at any point you receive a 401 status code from the API (including when you are trying to refresh), your token is not valid. You should then attempt to login again.

    Authentication

    Log in

    POST /authentication/login

    Attempt to authenticate with Odyssey. If we don't recognize you, we will return a 401 status code.

    Parameters

    Name Located in Description Type
    email request Your email address string
    password request Your password string

    Response

    {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXN0IjoidGhpcyBpcyBqdXN0IGFuIGV4YW1wbGUifQ.tRg7qdMaMa7HfLQi3TT8v0BaLiBpqdZz8ZkYLK023Rw"
    }
    

    Refresh an expired authentication token

    POST /authentication/refresh

    This method uses the token given in the Authorization header.

    Returns a 401 if the token can not be refreshed for any reason.

    Response

    {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXN0IjoidGhpcyBpcyBqdXN0IGFuIGV4YW1wbGUifQ.tRg7qdMaMa7HfLQi3TT8v0BaLiBpqdZz8ZkYLK023Rw"
    }
    

    POST /authentication/password/forgot

    Parameters

    Name Located in Description Type
    email request the users email address string

    Response

    "Request has been received"
    

    Resets the users password

    POST /authentication/password/reset

    Parameters

    Name Located in Description Type
    email request the users email address string
    token request token that has been sent by email to the user string
    password request min:6 the new password string
    password_confirmation request repeat the new password string

    Response

    null
    

    Invites

    Retrieve an invite

    GET /invites/{invite}

    Parameters

    Name Located in Description Type
    invite path \Invite

    Response

    {
        "email": "you@example.com",
        "code": "XXXXXXXXXXXXXXX",
        "used": false,
        "from": "User name",
        "account": {
            "id": 2,
            "name": "Account name",
            "analyse_args": {
                "max_days": 90
            },
            "currency_code": "USD",
            "archived": 0,
            "encrypted": 0,
            "display_settings": "{\"extrapolate\":false}",
            "source_rules": {
                "root": {
                    "type": "field",
                    "field": "channelGrouping"
                },
                "rules": [
                    {
                        "rule": {
                            "===": [
                                {
                                    "type": "current"
                                },
                                {
                                    "type": "field",
                                    "field": "trafficSource.source"
                                }
                            ]
                        },
                        "child_expression": {
                            "type": "field",
                            "field": "trafficSource.campaign"
                        }
                    },
                    {
                        "rule": {
                            "===": [
                                {
                                    "type": "current"
                                },
                                {
                                    "type": "field",
                                    "field": "channelGrouping"
                                }
                            ]
                        },
                        "child_expression": {
                            "type": "field",
                            "field": "trafficSource.source"
                        }
                    }
                ]
            }
        },
        "view": null,
        "publisher": null
    }
    

    Accept an invite and register an account using it

    POST /invites

    This method can be called without authentication. A new user account will be created, and the invite will be accepted on behalf of the new user.

    Returns 201 if the action succeeds

    Parameters

    Name Located in Description Type
    code request Invite code string
    name request Name for the new user string
    email request Email for the new user string
    password request Password for the new user string

    Response

    {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXN0IjoidGhpcyBpcyBqdXN0IGFuIGV4YW1wbGUifQ.tRg7qdMaMa7HfLQi3TT8v0BaLiBpqdZz8ZkYLK023Rw"
    }
    

    Accept an invite

    PUT /invites

    This method accepts an invite as the authenticated user. Accepting the invite means that the user will be added to the account or view the invite is for.

    Parameters

    Name Located in Description Type
    code request Invite code string

    Response

    201

    Users

    Get info about the logged in user

    GET /users/me

    Response

    {
        "name": "name",
        "email": "example@email.co",
        "agency": {
            "id": 1,
            "name": "Agency Name"
        },
        "id": "me",
        "roles": [
            "admin"
        ]
    }
    

    Accounts

    List all accounts you have access to

    GET /accounts/list

    Parameters

    Name Located in Description Type
    archived request (default: 0 (false)) boolean

    Response

    [
        {
            "id": 2,
            "name": "Account name",
            "analyse_args": {
                "max_days": 90
            },
            "currency_code": "USD",
            "main_view_id": 1,
            "archived": 0,
            "encrypted": 0,
            "display_settings": "{\"extrapolate\":false}",
            "source_rules": {
                "root": {
                    "type": "field",
                    "field": "channelGrouping"
                },
                "rules": [
                    {
                        "rule": {
                            "===": [
                                {
                                    "type": "current"
                                },
                                {
                                    "type": "field",
                                    "field": "trafficSource.source"
                                }
                            ]
                        },
                        "child_expression": {
                            "type": "field",
                            "field": "trafficSource.campaign"
                        }
                    },
                    {
                        "rule": {
                            "===": [
                                {
                                    "type": "current"
                                },
                                {
                                    "type": "field",
                                    "field": "channelGrouping"
                                }
                            ]
                        },
                        "child_expression": {
                            "type": "field",
                            "field": "trafficSource.source"
                        }
                    }
                ]
            },
            "canAccessSettings": true,
            "views": [
                {
                    "id": 1,
                    "name": "raw_data",
                    "account_id": 2,
                    "is_locked": 0,
                    "commission_function": "-2 * density.own * maxcom * (position -1)",
                    "max_com": 0.2
                }
            ]
        }
    ]
    

    Get all available account creation parameters

    GET /accounts/parameters

    Response

    {
        "collectors": {
            "App\\Analysis\\Collectors\\BigQueryAnalyticsCollector": {
                "display_name": "Google Analytics",
                "fields": [
                    {
                        "name": "dataset",
                        "display_name": "Data set",
                        "required": true,
                        "placeholder": "analytics.01234567",
                        "explanation": "The name of the BigQuery data set."
                    }
                ],
                "preprocessing": [
                    {
                        "class": "App\\Processing\\Pre\\Tasks\\GoogleAnalyticsRevenueTask",
                        "settings": []
                    }
                ],
                "semaphore": "App\\Semaphores\\BigQuerySemaphore",
                "default_hierarchy": "{\"root\":{\"type\":\"field\",\"field\":\"channelGrouping\"},\"rules\":[{\"rule\":{\"===\":[{\"type\":\"current\"},{\"type\":\"field\",\"field\":\"trafficSource.source\"}]},\"child_expression\":{\"type\":\"field\",\"field\":\"trafficSource.campaign\"}},{\"rule\":{\"===\":[{\"type\":\"current\"},{\"type\":\"field\",\"field\":\"channelGrouping\"}]},\"child_expression\":{\"type\":\"field\",\"field\":\"trafficSource.source\"}}]}"
            }
        },
        "hierarchical_rules_schema": {
            "$schema": "http:\/\/json-schema.org\/draft-07\/schema#",
            "title": "Odyssey hierarchical definition",
            "type": "object"
        }
    }
    

    Create a new account

    POST /accounts

    You can only do this if you have agency access.

    Parameters

    Name Located in Description Type
    name request string
    collector request \enum
    collector_args request \json
    analyse_args request \json
    currency_code request string
    source_rules request (optional) See /account/parameters endpoint for JSON schema to validate against. \json

    Response

    {
        "id": 1,
        "name": "Account name",
        "analyse_args": "{\"max_days\":90}",
        "currency_code": "USD",
        "main_view_id": 1,
        "archived": false,
        "encrypted": false,
        "canAccessSettings": true
    }
    

    Retrieve an account

    GET /accounts/{account}

    Parameters

    Name Located in Description Type
    account path \Account

    Response

    {
        "id": 1,
        "name": "Account name",
        "analyse_args": "{\"max_days\":90}",
        "currency_code": "USD",
        "main_view_id": 1,
        "archived": false,
        "encrypted": false,
        "canAccessSettings": true
    }
    

    Update an account

    PUT /accounts/{account}

    Parameters

    Name Located in Description Type
    account path \Account
    name request string
    analyse_args request \json
    main_view_id request \id
    archived request boolean

    Response

    US","analyse_args":{"max_days":90},"currency_code":"USD","main_view_id":1,"archived":0,"encrypted":0,"display_settings":"{"extrapolate":false}","source_rules":{"root":{"type":"field","field":"channelGrouping"},"rules":[{"rule":{"===":[{"type":"current"},{"type":"field","field":"trafficSource.source"}]},"child_expression":{"type":"field","field":"trafficSource.campaign"}},{"rule":{"===":[{"type":"current"},{"type":"field","field":"channelGrouping"}]},"child_expression":{"type":"field","field":"trafficSource.source"}}]},"canAccessSettings":true}

    Get the range of available data for a given account

    GET /accounts/{account}/datarange

    Parameters

    Name Located in Description Type
    account path \Account

    Response

    {
        "ranges": [
            {
                "start": "2018-10-10",
                "end": "2018-10-10"
            }
        ],
        "startDate": "2018-10-10",
        "endDate": "2018-10-10"
    }
    

    Attempt to trigger data collection for the given account in the given date range

    POST /accounts/{account}/collect/{from}/{to}

    If the given date range does not make for a continuous segment with the existing data, it will be extended

    Parameters

    Name Located in Description Type
    account path \Account
    from path
    to path

    Response

    201

    Get the job log for a given account

    GET /accounts/{account}/jobs/list

    TODO: document params and return for pagination

    Parameters

    Name Located in Description Type
    account path \Account
    page request (query)(optional) The number of the requested page. int

    Response

    {
        "current_page": 1,
        "data": [
            {
                "id": 30,
                "created_at": "2018-10-15 15:24:13",
                "updated_at": "2018-10-15 15:24:13",
                "state": "finished",
                "description": "Calculates data for view TEST on date Oct 10, 2018",
                "error": "0",
                "progress": 1
            }
        ],
        "from": 1,
        "last_page": 2,
        "next_page_url": "{host}\/api\/accounts\/{account}\/jobs\/list?page=2",
        "path": "{host}\/api\/accounts\/{account}\/jobs\/list",
        "per_page": 10,
        "prev_page_url": null,
        "to": 10,
        "total": 16
    }
    

    Add a user to an account

    POST /accounts/{account}/users

    Parameters

    Name Located in Description Type
    account path \Account
    email request Email for the user to invite string

    Response

    "The invite has been sent"
    

    List all users in an account

    GET /accounts/{account}/users/list

    Parameters

    Name Located in Description Type
    account path \Account

    Response

    [
        {
            "name": "Name",
            "email": "example@email.co"
        }
    ]
    

    Remove user from an account

    DELETE /accounts/{account}/users/{email}

    Parameters

    Name Located in Description Type
    account path \Account
    email path string

    Response

    "The user has been removed"
    

    Create a view

    POST /accounts/{account}/views

    Parameters

    Name Located in Description Type
    account path \Account
    name request string
    from request View to copy translations from \id

    Response

    {
        "name": "View name",
        "account_id": 1,
        "id": 1
    }
    

    Get the views in an account

    GET /accounts/{account}/views/list

    Parameters

    Name Located in Description Type
    account path \Account

    Response

    [
        {
            "id": 1,
            "name": "Raw data",
            "account_id": 1,
            "is_locked": 0,
            "commission_function": "-2 * density.own * maxcom * (position -1)",
            "max_com": 0.2
        }
    ]
    

    Get view

    GET /accounts/{account}/views/{view}

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View

    Response

    {
        "id": 1,
        "name": "Raw data",
        "account_id": 1,
        "is_locked": 0,
        "commission_function": "-2 * density.own * maxcom * (position -1)",
        "max_com": 0.2
    }
    

    Update a view

    PUT /accounts/{account}/views/{view}

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    name request string
    commission_function request string
    max_com request double

    Response

    {
        "id": 1,
        "name": "Raw data",
        "account_id": 1,
        "is_locked": 0,
        "commission_function": "-2 * density.own * maxcom * (position -1)",
        "max_com": 0.2
    }
    

    Remove a view

    DELETE /accounts/{account}/views/{view}

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View

    Response

    204

    Get a row of sample analysis data for a view

    GET /accounts/{account}/views/{view}/sample

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View

    Response

    {
        "traffic_source_id": 1,
        "traffic_source_name": "Direct",
        "current_commission": -1,
        "channel_grouping": "Direct",
        "view_id": 1,
        "volume": 1000,
        "revenue": 10000,
        "total_clicks": 1000,
        "position": 0.5,
        "length": 2,
        "cost": 50.09,
        "days": 1.2,
        "density": {
            "own": 0.5,
            "other": [
                {
                    "traffic_source_id": 3,
                    "traffic_source": "Google",
                    "channel_grouping": "Organic Search",
                    "density": 0.2
                },
                {
                    "traffic_source_id": 7,
                    "traffic_source": "Google",
                    "channel_grouping": "Paid Search",
                    "density": 0.01
                },
                {
                    "traffic_source_id": 5,
                    "traffic_source": "Newsletter",
                    "channel_grouping": "Email",
                    "density": 0.002
                }
            ]
        },
        "distribution": {
            "data": [
                1,
                0.80845607113291,
                0.6703536726046,
                0.5605402302315,
                0.50917447948189,
                0.38197152621337,
                0.35740465152519,
                0.3270878971298,
                0.31724814808399,
                0.3
            ],
            "max": 1000,
            "step": 8000
        },
        "suggested_commission": 0.1,
        "maxcom": 0.2
    }
    

    Get the lock status for a view

    GET /accounts/{account}/views/{view}/locked

    The lock indicates if any data analysis operations are running for a given view

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View

    Response

    0
    

    Get the range of available data for a view

    GET /accounts/{account}/views/{view}/datarange

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View

    Response

    {
        "startDate": "2016-01-01",
        "endDate": "2017-01-01"
    }
    

    Get the analysis grouped by a time period

    GET /accounts/{account}/views/{view}/analysis/{time_period}

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    time_period path options: daily, weekly, monthly, yearly string
    from request \date
    to request \date
    field request (optional) array
    traffic_source_id request (optional) array
    channel_grouping request (optional) array

    Response

    {
        "2018-10-10": [
            {
                "view_id": 1,
                "volume": 100,
                "revenue": 10000,
                "total_clicks": 10,
                "position": 0.44,
                "length": 2,
                "days": 0.19,
                "date": "2018-10-10",
                "cost": 100,
                "density": {
                    "own": 0.512922,
                    "other": [
                        {
                            "density": 0.212226,
                            "traffic_source_id": 121,
                            "traffic_source": "Paid Search",
                            "parent_id": null,
                            "children": []
                        }
                    ]
                },
                "distribution": {
                    "data": [
                        1
                    ],
                    "max": 139.8,
                    "step": 86.3
                },
                "suggested_commission": 0.1,
                "incrementality": 0.57,
                "traffic_source": {
                    "id": 2,
                    "name": "name",
                    "type": null,
                    "has_children": false,
                    "parent_id": 1
                }
            }
        ]
    }
    

    Get analysis for a given view with a given daterange

    GET /accounts/{account}/views/{view}/analysis/{from}/{to}

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    from path \date
    to path \date
    parnetid request (optional) integer
    fields request (optional) array

    Response

    null
    

    Get analysis for a given view with a given daterange

    GET /accounts/{account}/views/{view}/analysis/{from}/{to}/parent/{parentid}

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    from path \date
    to path \date
    parnetid request (optional) integer
    fields request (optional) array
    parentid path

    Response

    null
    

    Get the statistics of an analysis for a given view with a given daterange

    GET /accounts/{account}/views/{view}/analysis/{from}/{to}/stats

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    from path \date
    to path \date

    Response

    {
        "collected_days": [
            "2018-10-01"
        ],
        "total_revenue": 100000,
        "analysed_revenue": 75000,
        "total_journeys": 1000,
        "analysed_journeys": 1100,
        "filtered_stats": {
            "lost_not_full_journey": 295,
            "total_analysed_journeys": 1200,
            "lost_max_days": 5,
            "lost_no_revenue": 0,
            "unique_transactions": 1500
        }
    }
    

    Gets the search results for the given parameters

    GET /accounts/{account}/views/{view}/analysis/{from}/{to}/search

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    from path \date
    to path \date

    Response

    null
    

    Get all the sources that occur in this analysis

    GET /accounts/{account}/views/{view}/analysis/{from}/{to}/trafficsources

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    from path \date
    to path \date

    Response

    [
        {
            "id": 1,
            "account_id": 1,
            "name": "Paid Search",
            "parent_id": null,
            "type": "paid",
            "children": [
                {
                    "id": 2,
                    "account_id": 1,
                    "name": "google",
                    "parent_id": 1,
                    "type": "paid",
                    "children": [
                        {
                            "id": 3,
                            "account_id": 1,
                            "name": "Campaign",
                            "parent_id": 2,
                            "type": "paid",
                            "children": [
                                {
                                    "id": 4,
                                    "account_id": 1,
                                    "name": "Keyword",
                                    "parent_id": 3,
                                    "type": "paid"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "id": 5,
            "account_id": 1,
            "name": "Organic Search",
            "parent_id": null,
            "type": null,
            "children": [
                {
                    "id": 6,
                    "account_id": 1,
                    "name": "google",
                    "parent_id": 5,
                    "type": null
                }
            ]
        },
        {
            "id": 7,
            "account_id": 1,
            "name": "Direct (No Source)",
            "parent_id": null,
            "type": null,
            "children": [
                {
                    "id": 8,
                    "account_id": 1,
                    "name": "(direct)",
                    "parent_id": 7,
                    "type": null
                }
            ]
        }
    ]
    

    List the traffic sources in a view

    GET /accounts/{account}/views/{view}/trafficsources/list

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View

    Response

    [
        {
            "id": 3,
            "name": "google",
            "type": ""
        },
        {
            "id": 4,
            "name": "google",
            "type": ""
        }
    ]
    

    Get a traffic source from a view

    GET /accounts/{account}/views/{view}/trafficsources/{trafficsource}

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    source request \TrafficSource
    trafficsource path

    Response

    {
        "id": 1,
        "name": "google",
        "type": "paid",
        "parents": [
            {
                "id": 2,
                "name": "Paid Search"
            }
        ]
    }
    

    Get details for a traffic source

    GET /accounts/{account}/views/{view}/trafficsources/{trafficsource}/details

    TODO: this function probably will change, make documentation when finished.

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    trafficsource path \TrafficSource

    Response

    [
        {
            "view_id": 1,
            "volume": 761,
            "revenue": 43534.3622,
            "total_clicks": 5317,
            "position": 0.47862023653088,
            "length": 4.0919842312746,
            "days": 2.5448226018397,
            "date": "2018-10-08",
            "cost": null,
            "density": {
                "own": 0.060042614980289,
                "other": [
                    {
                        "density": 0.014795939553219,
                        "traffic_source_id": 124,
                        "traffic_source": "Organic Search",
                        "parent_id": null,
                        "children": []
                    }
                ]
            },
            "distribution": {
                "data": [
                    0.99224376731302,
                    1,
                    0.97479224376731,
                    0.68781163434903,
                    0.45318559556787,
                    0.89529085872577,
                    0.66648199445984,
                    0.44542936288089,
                    0.40470914127424,
                    0.3
                ],
                "max": 311.7,
                "step": 275.6
            },
            "suggested_commission": 0.012522001758596,
            "incrementality": 0.062610008792981,
            "traffic_source": {
                "id": 122,
                "name": "google",
                "type": null,
                "has_children": true,
                "parent_id": 121
            }
        }
    ]
    

    Get results for a traffic source for given $from and $to dates, with optional metric field filter.

    GET /accounts/{account}/views/{view}/trafficsources/{trafficsource}/analysis/{from}/{to}

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    trafficsource path \TrafficSource
    from path \date
    to path \date
    fields request (optional) array

    Response

    {
        "view_id": 1,
        "volume": 761,
        "revenue": 43534.3622,
        "total_clicks": 5317,
        "position": 0.47862023653088,
        "length": 4.0919842312746,
        "days": 2.5448226018397,
        "date": "2018-10-08",
        "cost": null,
        "density": {
            "own": 0.060042614980289,
            "other": [
                {
                    "density": 0.014795939553219,
                    "traffic_source_id": 124,
                    "traffic_source": "Organic Search",
                    "parent_id": null,
                    "children": []
                }
            ]
        },
        "distribution": {
            "data": [
                0.99224376731302,
                1,
                0.97479224376731,
                0.68781163434903,
                0.45318559556787,
                0.89529085872577,
                0.66648199445984,
                0.44542936288089,
                0.40470914127424,
                0.3
            ],
            "max": 311.7,
            "step": 275.6
        },
        "suggested_commission": 0.012522001758596,
        "incrementality": 0.062610008792981,
        "traffic_source": {
            "id": 122,
            "name": "google",
            "type": null,
            "has_children": true,
            "parent_id": 121
        }
    }
    

    List the users in a view

    GET /accounts/{account}/views/{view}/users/list

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View

    Response

    [
        {
            "name": "Niels",
            "email": "example@email.co"
        }
    ]
    

    Invite a user to a view

    POST /accounts/{account}/views/{view}/users

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    email request Email address for the user to invite string

    Response

    "The invite has been sent"
    

    Remove a user from a view

    DELETE /accounts/{account}/views/{view}/users/{email}

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    email path string

    Response

    "The user has been removed"
    

    Get the translations for a view

    GET /accounts/{account}/views/{view}/translations/list

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View

    Response

    [
        {
            "id": 1,
            "operator": "equals",
            "from": "google",
            "to": "Google",
            "view_id": 1,
            "parent_id": 121
        }
    ]
    

    Preview translations for a view

    POST /accounts/{account}/views/{view}/translations/preview

    Translation schema

    {
        "operator": "equals", //(equals/contains)
        "from": "Google",
        "parent_id": 1,
        "to": "Google", //(optional)
    }
    

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    translation request The translation to preview \Translation
    other_translations request (optional) The existing translations to keep [Translation]

    Response

    {
        "from": [
            {
                "account_id": 2,
                "volume": 761,
                "revenue": 43534.3622,
                "total_clicks": 5317,
                "position": 0.47862023653088,
                "length": 4.0919842312746,
                "days": 2.5448226018397,
                "distribution": {
                    "data": [
                        1,
                        0.96701570680628,
                        0.96151832460733,
                        0.70497382198952,
                        0.47774869109948,
                        0.85157068062828,
                        0.66099476439791,
                        0.44109947643979,
                        0.40994764397906,
                        0.3
                    ],
                    "max": 317.7,
                    "step": 279.5
                },
                "traffic_source": {
                    "id": 122,
                    "name": "google",
                    "type": "paid",
                    "has_children": true,
                    "parent_id": 121
                }
            }
        ],
        "to": [
            {
                "distribution": {
                    "data": [
                        1,
                        0.96701570680628,
                        0.96151832460733,
                        0.70497382198952,
                        0.47774869109948,
                        0.85157068062828,
                        0.66099476439791,
                        0.44109947643979,
                        0.40994764397906,
                        0.3
                    ],
                    "max": 317.7,
                    "step": 279.5
                },
                "volume": 761,
                "revenue": 43534.3622,
                "total_clicks": 5317,
                "position": 0.47862023653088,
                "length": 4.0919842312746,
                "days": 2.5448226018397,
                "traffic_source": {
                    "name": "Google"
                }
            }
        ]
    }
    

    Apply translations for a view

    POST /accounts/{account}/views/{view}/translations/apply

    Translation schema

    {
        "operator": "equals",// (equals/contains)
        "channel_grouping": "Paid Search",
        "from": "Google",
     "parent_id": 1,
        "to": "Google", //(optional)
    }
    

    TranslationModify schema

    {
        "id": 1,
        "operator": "equals", //(equals/contains) (optional)
        "from": "Google", //(optional)
     "parent_id": 1, //(optional)
        "to": "Google", //(optional)
    }
    

    Parameters

    Name Located in Description Type
    account path \Account
    view path \View
    create request (optional) The translations to be created [Translation]
    update request (optional) The translations to be updated [TranslationModify]
    delete request (optional) The translations to be deleted [TranslationModify]

    Response

    {
        "ok": true
    }
    

    Create a trafficSource.

    POST /accounts/{account}/trafficsources

    Parameters

    Name Located in Description Type
    type request string
    name request string
    parent_id request (optional) integer
    account path \Account
    trafficSource request \TrafficSource

    Response

    {
        "name": "Paid Search",
        "id": 1
    }
    

    Get a list of all the traffic source for one account. Traffic source consists of an ID and a name

    GET /accounts/{account}/trafficsources/list

    Parameters

    Name Located in Description Type
    account path \Account

    Response

    [
        {
            "id": 121,
            "name": "Paid Search",
            "type": null
        },
        {
            "id": 122,
            "name": "google",
            "type": null
        }
    ]
    

    Get a list of all the traffic source for one account. Traffic source consists of an ID and a name

    GET /accounts/{account}/trafficsources/list/{parentid}

    Parameters

    Name Located in Description Type
    account path \Account
    parentid path

    Response

    [
        {
            "id": 121,
            "name": "Paid Search",
            "type": null
        },
        {
            "id": 122,
            "name": "google",
            "type": null
        }
    ]
    

    Get available publishers in an account to share data with

    GET /accounts/{account}/trafficsources/publishers/available

    Parameters

    Name Located in Description Type
    account path \Account

    Response

    [
        {
            "id": 1,
            "name": "Publisher Name"
        }
    ]
    

    Get the traffic sources that have been shared for an account

    GET /accounts/{account}/trafficsources/publishers/list

    Parameters

    Name Located in Description Type
    account path \Account

    Response

    [
        {
            "id": 1,
            "name": "Google",
            "channel_grouping": "Paid Search",
            "shared_with": {
                "id": 3,
                "name": "Publisher Name",
                "permissions": {
                    "volume": 1,
                    "revenue": 1,
                    "total_clicks": 1,
                    "position": 1,
                    "length": 1,
                    "days": 1,
                    "density": 1,
                    "distribution": 1,
                    "incrementality": 1,
                    "children": 1,
                    "ga_sessions": 1,
                    "ga_bounces": 1,
                    "ga_new_users": 1
                }
            }
        }
    ]
    

    Retrieve a traffic source

    GET /accounts/{account}/trafficsources/{trafficsource}

    Parameters

    Name Located in Description Type
    account path \Account
    trafficsource path \TrafficSource

    Response

    {
        "id": 123,
        "name": "Trademark-Brand-B-EXACT",
        "type": "",
        "parents": [
            {
                "id": 122,
                "name": "google"
            },
            {
                "id": 121,
                "name": "Paid Search"
            }
        ]
    }
    

    Update/Set the type of a trafficSource and its children.

    PUT /accounts/{account}/trafficsources/{trafficsource}

    {
        "type": "paid" //(paid, commissionable, organic, null)
    }
    

    Parameters

    Name Located in Description Type
    type request string
    account path \Account
    trafficSource request \TrafficSource
    trafficsource path

    Response

    Retrieve a publisher

    GET /accounts/{account}/trafficsources/{trafficsource}/publisher

    Parameters

    Name Located in Description Type
    account path \Account
    trafficsource path \TrafficSource

    Response

    {
        "id": 3,
        "name": "Google",
        "permissions": {
            "volume": 1,
            "revenue": 1,
            "total_clicks": 1,
            "position": 1,
            "length": 1,
            "days": 1,
            "density": 1,
            "distribution": 1,
            "suggested_commission": 1,
            "children": 1,
            "ga_sessions": 1,
            "ga_bounces": 1,
            "ga_new_users": 1
        }
    }
    

    Unshare data with a publisher

    DELETE /accounts/{account}/trafficsources/{trafficsource}/publisher

    Parameters

    Name Located in Description Type
    account path \Account
    trafficsource path \TrafficSource

    Response

    "Traffic source successfully un-shared"
    

    Share account data with a publisher

    PUT /accounts/{account}/trafficsources/{trafficsource}/publisher/{publisher}

    Example body

    {
        "volume": true,
        "length": true,
        "density": true,
        "distribution": true,
        "days": true,
        "position": true,
        "revenue": true,
        "total_clicks": true,
        "incrementality": true,
        "children": true,
        "ga_sessions": true
        "ga_bounces": true
        "ga_new_users": true
    }
    

    Parameters

    Name Located in Description Type
    account path \Account
    trafficsource path \TrafficSource
    publisher path \Publisher
    volume request (optional) boolean
    length request (optional) boolean
    density request (optional) boolean
    distribution request (optional) boolean
    days request (optional) boolean
    position request (optional) boolean
    revenue request (optional) boolean
    cost request (optional) boolean
    incrementality request (optional) boolean
    children request (optional) boolean
    ga_sessions request (optional) boolean
    ga_bounces request (optional) boolean
    ga_new_users request (optional) boolean

    Response

    "Traffic source successfully shared"
    

    Share account data with a publisher and create and invite publiser if publisher does not exists

    POST /accounts/{account}/trafficsources/{trafficsource}/publisher

    Example body

    {
        "volume": true,
        "length": true,
        "density": true,
        "distribution": true,
        "days": true,
        "revenue": true,
        "total_clicks": true,
        "position": true,
        "incrementality": true,
        "children": true,
        "ga_sessions": true
        "ga_bounces": true
        "ga_new_users": true
        "name": "newPublisher",
        "email": "new-publisher@example.com"
    }
    

    Parameters

    Name Located in Description Type
    account path \Account
    trafficsource path \TrafficSource
    publisher request \Publisher
    volume request (optional) boolean
    length request (optional) boolean
    density request (optional) boolean
    distribution request (optional) boolean
    days request (optional) boolean
    position request (optional) boolean
    incrementaltiy request (optional) boolean
    children request (optional) boolean
    ga_sessions request (optional) boolean
    ga_bounces request (optional) boolean
    ga_new_users request (optional) boolean
    name request (required) string
    email request (required) string

    Response

    "Traffic source successfully shared"
    

    Get the dates for account

    GET /accounts/{account}/dates/list

    Parameters

    Name Located in Description Type
    account path \Account

    Response

    [
        {
            "id": 1,
            "account_id": 1,
            "date": "2018-01-01",
            "filtered": "{\"complete_journeys\":518,\"lost_not_full_journey\":81,\"unique_transactions\":598,\"lost_max_days\":0,\"lost_no_revenue\":0}",
            "extra": {
                "revenue": 4792.95
            },
            "collected": 1,
            "tries": 0,
            "analysed_journeys": 518
        }
    ]
    

    Get the total analyzed journeys

    GET /accounts/{account}/dates/journeys

    Parameters

    Name Located in Description Type
    account path \Account

    Response

    2000
    

    Publishers

    List all publishers of user

    GET /publishers/list

    Response

    [
        {
            "id": 1,
            "name": "Publisher Name"
        }
    ]
    

    Retrieve a publisher

    GET /publishers/{publisher}

    Parameters

    Name Located in Description Type
    publisher path \Publisher

    Response

    {
        "id": 1,
        "name": "Publisher Name"
    }
    

    Get the range of data available for a publisher

    GET /publishers/{publisher}/datarange

    Parameters

    Name Located in Description Type
    publisher path \Publisher

    Response

    {
        "startDate": "2016-01-01",
        "endDate": "2017-01-01"
    }
    

    Get analysis results for a publisher

    GET /publishers/{publisher}/analysis/{from}/{to}

    The returned result depends on the permissions the publisher has.

    Parameters

    Name Located in Description Type
    publisher path \Publisher
    from path \date
    to path \date
    parnetid request (optional) integer

    Response

    [
        {
            "view_id": 1,
            "volume": 738,
            "revenue": 42375.9912,
            "total_clicks": 5026,
            "position": 0.48,
            "length": 4,
            "days": 2.28,
            "cost": null,
            "density": {
                "own": 0.600279,
                "other": [
                    {
                        "density": 0.194588,
                        "traffic_source_id": 124,
                        "traffic_source": "Organic Search",
                        "parent_id": null,
                        "children": []
                    }
                ]
            },
            "distribution": {
                "data": [
                    0.97941176470588,
                    0.96069518716578,
                    1,
                    0.71176470588235,
                    0.46844919786097,
                    0.84652406417113,
                    0.64812834224599,
                    0.41604278074867,
                    0.41229946524064,
                    0.3
                ],
                "max": 319.1,
                "step": 281.7
            },
            "suggested_commission": 0.124858032,
            "incrementality": 0.62429016,
            "traffic_source": {
                "id": 121,
                "name": "Paid Search",
                "type": "paid",
                "has_children": true,
                "parent_id": null
            },
            "advertiser_name": "Name",
            "currency_code": "USD"
        }
    ]
    

    Get analysis results for a publisher

    GET /publishers/{publisher}/analysis/{from}/{to}/parent/{parentid}

    The returned result depends on the permissions the publisher has.

    Parameters

    Name Located in Description Type
    publisher path \Publisher
    from path \date
    to path \date
    parnetid request (optional) integer
    parentid path

    Response

    [
        {
            "view_id": 1,
            "volume": 738,
            "revenue": 42375.9912,
            "total_clicks": 5026,
            "position": 0.48,
            "length": 4,
            "days": 2.28,
            "cost": null,
            "density": {
                "own": 0.600279,
                "other": [
                    {
                        "density": 0.194588,
                        "traffic_source_id": 124,
                        "traffic_source": "Organic Search",
                        "parent_id": null,
                        "children": []
                    }
                ]
            },
            "distribution": {
                "data": [
                    0.97941176470588,
                    0.96069518716578,
                    1,
                    0.71176470588235,
                    0.46844919786097,
                    0.84652406417113,
                    0.64812834224599,
                    0.41604278074867,
                    0.41229946524064,
                    0.3
                ],
                "max": 319.1,
                "step": 281.7
            },
            "suggested_commission": 0.124858032,
            "incrementality": 0.62429016,
            "traffic_source": {
                "id": 121,
                "name": "Paid Search",
                "type": "paid",
                "has_children": true,
                "parent_id": null
            },
            "advertiser_name": "Name",
            "currency_code": "USD"
        }
    ]
    

    Add a user to an publisher

    POST /publishers/{publisher}/users

    Parameters

    Name Located in Description Type
    publisher path \Publisher
    email request Email for the user to invite string

    Response

    "The invite has been sent"
    

    List all users associated with publisher

    GET /publishers/{publisher}/users/list

    Parameters

    Name Located in Description Type
    publisher path \Publisher

    Response

    [
        {
            "name": "Name",
            "email": "example@email.co"
        }
    ]
    

    Remove user from an account

    DELETE /publishers/{publisher}/users/{email}

    Parameters

    Name Located in Description Type
    publisher path \Publisher
    email path string

    Response

    "The user has been removed"
    

    Get trafficSource for publishers

    GET /publishers/{publisher}/trafficsources/{trafficsource}

    Parameters

    Name Located in Description Type
    publisher path
    trafficsource path

    Response

    null
    

    Tours

    Check whether or not a tour with this name should be started

    GET /tours/{name}

    Parameters

    Name Located in Description Type
    tour request Tour to check this for string
    name path

    Response

    true

    Mark a tour as finished

    POST /tours/{name}

    Parameters

    Name Located in Description Type
    tour request Tour to mark as finished string
    name path

    Response

    Mark a tour as skipped

    DELETE /tours/{name}

    Parameters

    Name Located in Description Type
    tour request Tour to mark as skipped string
    name path

    Response