InPlayer Analytics API (2.0.0)

Download OpenAPI specification:Download

INTRODUCTION

The InPlayer paywall platform enables you up to create a detailed subscription business which allows you to build a consumer base and drive significant revenues. Our paywall supports recurring payments and billing, consumer acquisition, subscriber lifecycle management, and provides you with consumer retention CRM tools.

Once you have an InPlayer Merchant Account you can use our dashboard at https://dashboard.inplayer.com to publish, manage, and sell 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. Standard HTTP response codes are used to indicate API errors or success requests. Every InPlayer Core Resource has its own URL and each operation (GET, POST, PUT, and DELETE) carries a specific meaning.

All API requests should be made with Content-Type:application/x-www-form-urlencoded header.

All API responses are returned in JSON, regardless if the response indicates 'success' or 'error'.

DOCS TERMINOLOGY

In the section below, you can find explained the terms used for the Core Resources in the InPlayer Platform. Make sure you have read the explanations before starting a 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, in the Account Details section, as Account ID.

API ENVIRONMENTS

To make the API as explorable as possible, we have two different environments - live environment and testing environment. As there is no switch for changing between modes, simply refer to the appropriate URL for the appropriate environment, from our API servers.

ERRORS

InPlayer uses the conventional HTTP response codes for indicating either 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 - a failure given the information provided (e.g. the omission of a required parameter, a charge that failed, etc.), and codes in the 5xx range indicate an error with the InPlayer's servers.

Not all errors map cleanly onto HTTP response codes, however. When a request is valid but does not complete successfully (e.g., asset access is not found), we return the 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 doesn't 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.

##########################################################################################################

Authentication

bearerAuth

You can create a JSON Web Token (JWT) via the authenticate endpoint. Usage format: Bearer <JWT>

Security scheme type: HTTP
HTTP Authorization Scheme bearer
Bearer format "JWT"

V2

All operations related to analytics.

Get list of generated files for Content Requests

Returns list of files for content requests

Authorizations:

Responses

200

OK

401

Unauthorized

404

Not Found

500

Unable to process the request

get /v2/analytics/content-requests

Staging Server

https://staging-v2.inplayer.com/v2/analytics/content-requests

Production Server

https://services.inplayer.com/v2/analytics/content-requests

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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:
path Parameters
file_name
required
string

File name

Responses

200

OK

401

Unauthorized

500

Unable to process the request

get /v2/analytics/content-requests/download/{file_name}

Staging Server

https://staging-v2.inplayer.com/v2/analytics/content-requests/download/{file_name}

Production Server

https://services.inplayer.com/v2/analytics/content-requests/download/{file_name}

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "redirect_url": "string"
}

Generate csv report

Generating content request report

Authorizations:
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

200

OK

401

Unauthorized

404

Not Found

500

Unable to process the request

post /v2/analytics/content-requests/generate

Staging Server

https://staging-v2.inplayer.com/v2/analytics/content-requests/generate

Production Server

https://services.inplayer.com/v2/analytics/content-requests/generate

Request samples

Copy
    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
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "string"
}

Get Customer Last Login Record

Returns Account Login Record

Authorizations:
path Parameters
id
required
integer

Customer ID

Responses

200

OK

401

Unauthorized

404

Not Found

500

Unable to process the request

get /v2/analytics/customers/{id}/activity

Staging Server

https://staging-v2.inplayer.com/v2/analytics/customers/{id}/activity

Production Server

https://services.inplayer.com/v2/analytics/customers/{id}/activity

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "last_login":
    {
    },
  • "content_requests_log":
    {
    }
}

Get Customer Lifetime Value

Returns Customer Lifetime Value

Authorizations:
path Parameters
id
required
integer

Customer ID

Responses

200

OK

401

Unauthorized

404

Not Found

422

Unprocessable entity

get /v2/analytics/customers/{id}/lifetime

Staging Server

https://staging-v2.inplayer.com/v2/analytics/customers/{id}/lifetime

Production Server

https://services.inplayer.com/v2/analytics/customers/{id}/lifetime

Request samples

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

Response samples

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

Get Login Analytics

Returns Account Login Analytics

Authorizations:

Responses

200

OK

401

Unauthorized

404

Not Found

get /v2/analytics/customers/logins

Staging Server

https://staging-v2.inplayer.com/v2/analytics/customers/logins

Production Server

https://services.inplayer.com/v2/analytics/customers/logins

Request samples

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

Response samples

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

Get Registrations Analytics

Returns Account Registrations Analytics

Authorizations:

Responses

200

OK

401

Unauthorized

404

Not Found

get /v2/analytics/customers/registrations

Staging Server

https://staging-v2.inplayer.com/v2/analytics/customers/registrations

Production Server

https://services.inplayer.com/v2/analytics/customers/registrations

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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:
query Parameters
start_date
string

Start date for analytics

end_date
string

End date for analytics

Responses

200

Payment analytics per payment type and currency

401

Unauthorized

422

Unprocessable entity

500

Internal server error

get /v2/analytics/payments

Staging Server

https://staging-v2.inplayer.com/v2/analytics/payments

Production Server

https://services.inplayer.com/v2/analytics/payments

Request samples

Copy
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
Copy
Expand all Collapse all
{
  • "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:
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

200

OK

400

StatusBadRequest

404

Not found