Report a preview stream

 \ Example request

POST https://api.7digital.com/1.2/user/preview/log?country=EE&oauth_consumer_key=YOUR_KEY_HERE&oauth_token=...

A country parameter is required in the query string. This is for OAuth authorisation, and must be a country your API key has access to. The country property in the POST body is the location in which the user played the clip.

Multiple plays can be batched into a single POST to this endpoint, up to a limit of 500 logs. The body must be sent as JSON format. Previews that are requested as part of pre-fetching functionality, but never played on the device, should still be logged with a zero second play time.

{
  "logs": [
    {
      "userId": "141732543",
      "country": "EE",
      "trackId": 673059,
      "dateTimePlayed": "2014-03-13T11:39:28.8981203Z",
      "totalTimePlayed": 12,
      "userAgent": "Device version 3, App version 6",
      "playMode":"online",
      "playType":"view"
    }
  ]
}

Example Response

{}
{
    "error": {
        "code": 1008,
        "message": "One or more logs contain an error",
        "errors": [
            {
                "code": 1002,
                "message": "'Date Time Played' cannot be too much in the past.",
                "index": 4
            }
        ]
    }
}

An HTTP 200 response means all logs were submitted successfully.

An HTTP non-200 response means we have not saved any logs. Errors should be fixed, and the whole batch resubmitted.

Specific Error Codes

  • 1008 - One or more logs are invalid. Refer to the index field to know which logs failed and why.
Query Params
string
required
Form Data
string
required
string
required
int32
required
string
required
string
required
int32
required
string
required
string
Language
LoadingLoading…