InPlayer Analytics API (2.0.0)

Download OpenAPI specification:Download

INTRODUCTION

InPlayer equips you to run a detailed subscription business model, to build and grow your consumer base, and drive significant revenues. Our paywall supports recurring payments and billing cycles, consumer acquisition, subscriber lifecycle management, and provides you with consumer retention CRM tools.

Once you create an InPlayer Merchant Account, you are entitled to using our InPlayer dashboard for publishing, managing, and selling your premium content. Moreover, you can always integrate with our APIs for a full custom integration.

INPLAYER API

The InPlayer API follows the REST architectural style and uses standard HTTP response codes to indicate success requests (2xx) or API errors (4xx, 5xx). Each of the InPlayer Core Resources (Accounts & Authentication, Asset & Access, Payments & Subscriptions, Vouchers & Promotions, Branding, Restrictions & Rules, Reporting, Analytics, and Features) has their own URL and each of the operations involved (POST, PUT, PATCH, GET, and DELET) carries a specific meaning like creating, updating, fetching, deleting data, and much more.

All API requests should contain Content-Type:application/x-www-form-urlencoded header. The responses are always returned in JSON object(s), both for the successful requests and the failed attempts (errors).

DOCS TERMINOLOGY

The following section defines the domain language used across our platform. Proceed reading to introduce yourself to the terms employed for each of our Core Resources before you start working on your custom integration.

Accounts and Account Types

Term Explanation
merchant The Merchants are those who have ownership of the premium content.
consumer The Consumers are those who can view or buy the premium content.
customer The Customers are those who have made at least one purchase.
uuid Stands for the Unique Identifier of the Merchant. You can find it on the InPlayer's dashboard at the Account Details section as Account ID.

API ENVIRONMENTS

To make the API as explorable as possible, we have two different environments for production related and testing purposes. There is no switch for changing between modes, so just refer to the URL you need.

ERRORS

InPlayer uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g. a required parameter was omitted, a charge failed, etc.), and codes in the 5xx range indicate an error with InPlayer's servers.

Not all errors map cleanly onto HTTP response codes, however. For instance, When a request is valid but does not complete successfully (e.g. if asset access is not found), we return a 402 error code.

List of status codes

Status code Explanation
200 OK Everything worked as expected.
201 Created The resource has been created.
202 Accepted The request has been accepted for processing but the processing has not been completed.
204 No Content The server has fulfilled the request but does not need to return an entity-body.
400 Bad Request The request was unacceptable, often due to omission of a required parameter.
401 Unauthorized No valid access token has been provided.
402 Request Failed The parameters were valid but the request failed.
404 Not Found The requested resource does not exist.
409 Conflict The request conflicts with another request.
429 Too Many Requests Too many requests have been sent to the API in a short amount of time. We recommend using exponential backoff for your requests.
500, 502, 503, 504 Server Errors Something went wrong on InPlayer's end.

V2

All operations related to analytics.

Get list of generated files for Content Requests

Returns list of files for content requests

Authorizations:
bearerAuth

Responses

Request samples

curl https://services.inplayer.com/v2/analytics/content-requests
    -H "Authorization:Bearer <token>"

Response samples

Content type
application/json
{
  • "name": "content_requests_55761_2020-01-21.csv",
  • "created_at": 1582205986
}

Get redirect url for downloading csv report

Returns redirect url for downloading csv record

Authorizations:
bearerAuth
path Parameters
file_name
required
string

File name

Responses

Request samples

curl https://services.inplayer.com/v2/analytics/content-requests/{file_name}
    -H "Authorization:Bearer <token>"

Response samples

Content type
application/json
{
  • "redirect_url": "string"
}

Generate csv report

Generating content request report

Authorizations:
bearerAuth
Request Body schema: application/x-www-form-urlencoded
item_id
required
int

Item ID

start_date
required
string

Start date of report

end_date
required
string

End date of report

Responses

Request samples

    curl https://services.inplayer.com/v2/analytics/content-requests/generate \
    -d item_id=23423 \
    -d start_date=2006-01-02 15:04:05 \
    -d end_date=2006-01-02 15:04:05

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get Customer Last Login Record

Returns Account Login Record

Authorizations:
bearerAuth
path Parameters
id
required
integer

Customer ID

Responses

Request samples

curl https://services.inplayer.com/v2/analytics/customers/{id}/activity \
    -H "Authorization: Bearer <token>"

Response samples

Content type
application/json
{
  • "last_login": {
    },
  • "content_requests_log": {
    }
}

Get Customer Lifetime Value

Returns Customer Lifetime Value

Authorizations:
bearerAuth
path Parameters
id
required
integer

Customer ID

Responses

Request samples

curl https://services.inplayer.com/v2/analytics/customers/{id}/lifetime \
    -H "Authorization: Bearer <token>"

Response samples

Content type
application/json
{
  • "total_assets_bought": 10,
  • "money_spent": [
    ],
  • "first_purchase": {
    },
  • "last_purchase": {
    }
}

Get Login Analytics

Returns Account Login Analytics

Authorizations:
bearerAuth

Responses

Request samples

curl https://services.inplayer.com/v2/analytics/customers/logins \
    -H "Authorization: Bearer <token>"

Response samples

Content type
application/json
{
  • "total": 10,
  • "per_device": [
    ],
  • "per_country": [
    ]
}

Get Registrations Analytics

Returns Account Registrations Analytics

Authorizations:
bearerAuth

Responses

Request samples

curl https://services.inplayer.com/v2/analytics/customers/registrations \
    -H "Authorization: Bearer <token>"

Response samples

Content type
application/json
{
  • "total": 10,
  • "per_device": [
    ],
  • "per_country": [
    ],
  • "per_register_source": [
    ]
}

Get payment analytics per payment type and currency

Returns the payment analytics per payment type and currency.

Authorizations:
bearerAuth
query Parameters
start_date
string

Start date for analytics

end_date
string

End date for analytics

Responses

Request samples

curl https://services.inplayer.com/v2/analytics/payments
    -H "Authorization:Bearer <token>"
    -d start_date=2006-01-02 15:04:05 \
    -d end_date=2006-01-02 15:04:05

Response samples

Content type
application/json
{
  • "payment_analytics": {
    },
  • "refund_analytics": {
    }
}

Get subscriptions analytics per country, price, item or only by action types.

Returns list of subscriptions group by country, price, item or only by action types

Authorizations:
bearerAuth
query Parameters
country_code
any
Example: country_code=MKD

subscriptions grouped by all countries or certain country_code (MKD, DEU...)

grouped_by
any
Example: grouped_by=price

subscriptions grouped by price or item

action_type
any
Example: action_type=recurrent

subscriptions grouped by all action types or certain type (recurrent, canceled ...)

Responses

Request samples

curl https://services.inplayer.com/v2/analytics/subscriptions?country_code=MK&grouped_by=price&action_type=recurrent  \
    -H "Authorization: Bearer <token>"

Response samples

Content type
application/json
{
  • "country_code": "MK",
  • "country_name": "Macedonia",
  • "total_subcriptions": 10,
  • "grouped_by": "price",
  • "subscriptions_grouped_by": [
    ]
}