Contents

API reference

Every endpoint, field and response of the export API. Generated from openapi.yaml (OpenAPI 3.1, also as JSON).

  • Base URL: https://global-api.attentionpanel.com
  • Auth: Authorization: <api key> on every request, no scheme prefix.
  • Body: JSON in and out. Unknown request fields are rejected.
  • Errors: { "statusCode": 400, "message": "FROM_DATE_NOT_ALLOWED" }. The message is the code to branch on.

Create an export

POST /impressions/export

Starts an export job for one platform, market and inclusive range of UTC dates.

Request body

FieldTypeDescription
devicestring · requiredThe platform. One of mobile, desktop.
marketstring · requiredThe market. One of semarket, nomarket, dkmarket, fimarket.
from_datedate · requiredYYYY-MM-DD, inclusive. Not before the key's earliest allowed date.
to_datedate · requiredYYYY-MM-DD, inclusive. Not before from_date.
include_html_metadatabooleanDesktop only. Adds html_metadata when the key is entitled to it.
versionstringMobile only. The mobile data version; v1 when omitted. v2 data starts on a date set per deployment: an earlier from_date returns 400 V2_FROM_DATE_NOT_AVAILABLE with that date in available_from. One of v1, v2.

Response 200

FieldTypeDescription
export_idstring · requiredUse in the other endpoints. URL-encode it in paths.
statusstring · requiredAlways RUNNING.
versionstringThe data version the job exports. One of v1, v2.

Errors

Status · messageCause
400 (validation message)Missing or unknown field, bad date, or from_date after to_date.
400 FROM_DATE_NOT_ALLOWEDfrom_date is before the key's earliest allowed date.
400 MAX_PARALLEL_RUNS_LIMIT_REACHEDThe key already has its maximum number of running jobs for this platform, market and version.
400 V2_FROM_DATE_NOT_AVAILABLEversion v2 with from_date before the first day of v2 data, which available_from gives (YYYY-MM-DD).
400 V2_ONLY_AVAILABLE_FOR_MOBILEversion v2 with a device other than mobile.
401No Authorization header.
403Invalid key, or platform or market outside its entitlements.

Get an export

GET /exports/{export_id}

Returns the job's state, and the files once it has succeeded.

Response 200

FieldTypeDescription
statusstring · requiredOnly RUNNING changes. One of RUNNING, SUCCEEDED, FAILED, CANCELLED.
versionstringThe data version the job exports. One of v1, v2.
download_urlsstring[]On SUCCEEDED. Presigned, one per file, valid 24 hours after completion. Send no Authorization header to them.
failure_reasonstringOn FAILED: NO_DATA (no rows for the request) or INTERNAL_ERROR. One of NO_DATA, INTERNAL_ERROR.

Errors

Status · messageCause
400 EXPORT_EXPIREDThe download URLs are older than 24 hours. Create a new export.
404Unknown export_id, or one created with another key.

Cancel an export

POST /exports/{export_id}/cancel

Stops a running job.

Response 200

FieldTypeDescription
export_idstring · requiredThe cancelled job.
statusstring · requiredAlways CANCELLED.

Errors

Status · messageCause
400 EXPORT_NOT_IN_CANCELABLE_STATEThe job is no longer running.
404Unknown export_id, or one created with another key.