EX.CO API

The EX.CO Reports API attempt to conform to the REST design principle. EX.CO Reports API support the JSON data format for responses and in some cases, when requested, CSV.


NOTE: All API requests must be made over HTTPS. Calls made over HTTP are not allowed.


API Reference


The EX.CO API uses API tokens to authenticate API calls. Use provided ACCOUNT_ID and ACCOUNT_SECRET to get an access token. This API token will be expired after a short period of time, we recommend generating a new API token before any API call.


Authentication API base URL:

https://authentication.playbuzz.com


Access Token
POST /account/accessToken


The Access Token Object Parameters (BODY)


Property

Required

Description

accountId

Required

Your unique account ID

accountSecret

Required

Your unique account secret

grantType

Required

Authentication method. For API tokens use accountSecret

Example Request for an access token


  • cURL
  • Node.js


Example Response to a successful request

{
    accountId: "ACCOUNT_ID",
    accessToken: "GENERATED_ACCESS_TOKEN"
}


Use generated accessToken value in the Authorization header on each API request:

Authorization: Bearer GENERATED_ACCESS_TOKEN
x-pb-user-id: EXCO_USER_ID

HTTP Status Codes


EX.CO API's uses conventional HTTP response code types


Code

Type

Description

200

OK

Everything worked as expected.

400

invalid_request_error

Handled programmatically depends report generation error

401

authentication_error

No valid 'x-pb-user-id' provided, No valid Authorization token provided

401

authentication_error

No valid Authorization token provided

403


internal_service_error

No Available channels

404

internal_service_error

Page Not Found

500

internal_service_error

Internal Server Error

504

api_error

Request was timed out due to a too big response

Versioning


API version is part of the URL structure of EX.CO API. To set the API version on a specific request, add the requested version like the following:

https://reports.ex.co/api/v1/
NOTE: Please read our API release notes before migrating into a newer version, some changes can be backward-incompatible.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us how can we improve this article!

Select atleast one of the reasons

Feedback sent

We apprciate your effort and will try to fix the article