InPlayer Features 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 DELETE) 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 features.

Get list of Features Availability

Returns list of availabiltiy for all features.

Authorizations:
bearerAuth

Responses

Request samples

    curl -x GET https://services.inplayer.com/v2/features
    -H "Authorization:Bearer <token>"

Response samples

Content type
application/json
{
  • "features_availiability": {
    }
}

Add new feature

Registering new feature for enabiling/disabiling.

Authorizations:
bearerAuth
Request Body schema: application/x-www-form-urlencoded
name
required
string

Feature name

strategy
required
string
Enum: "global" "accountWithId"

The strategy for enabling/disabiling feature

enabled
required
boolean

Whether the feature is enabled or disabled (disabled feature is never avaialable regardless of strategy)

account_ids
Array of arrays

The IDs for which accounts this feature is enabled (required only if strategy is "accountWithId")

Responses

Request samples

    curl -x POST staging-v2.inplayer.com/v2/features \
    -H "Authorization:Bearer <token>" \
    -d name="Feature Name" \
    -d strategy=accountWithId \
    -d enabled=1 \
    -d account_ids=1 \
    -d account_ids=2

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully added feature"
}

Delete feature

Removes a given feature with all its connections to accounts

Authorizations:
bearerAuth

Responses

Request samples

    curl -x DELETE staging-v2.inplayer.com/v2/features/{name} \
    -H "Authorization:Bearer <token>" \

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully deleted feature"
}

Update feature

Recreates the entire feature.

Authorizations:
bearerAuth
Request Body schema: application/x-www-form-urlencoded
strategy
required
string
Enum: "global" "accountWithId"

The strategy for enabling/disabiling feature

enabled
required
boolean

Shows whether the feature is enabled or disabled (disabled feature is never avaialable regardless of the "strategy")

account_ids
Array of arrays

The IDs for which accounts this feature is enabled (required only if strategy is "accountWithId")

Responses

Request samples

    curl -x PUT staging-v2.inplayer.com/v2/features/{name} \
    -H "Authorization:Bearer <token>" \
    -d strategy=accountWithId \
    -d enabled=1 \
    -d account_ids=1 \
    -d account_ids=2

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully recreated feature"
}

Update part of the feature

Updates an existent feature or creates a new feature. In case the feature with the specified name is non-existent, the strategy and enabled parametes are required to create the feature.

Authorizations:
bearerAuth
Request Body schema: application/x-www-form-urlencoded
strategy
string
Enum: "global" "accountWithId"

The strategy for enabling/disabiling feature

enabled
boolean

Shows whether the feature is enabled or disabled (disabled feature is never avaialable regardless of strategy)

account_ids
Array of arrays

The IDs for which accounts this feature is enabled (required only if strategy is "accountWithId")

Responses

Request samples

    curl -x PATCH staging-v2.inplayer.com/v2/features/{name} \
    -H "Authorization:Bearer <token>" \
    -d strategy=accountWithId \
    -d enabled=1 \
    -d account_ids=1 \
    -d account_ids=2

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully updated feature"
}

Get list of Features Availability for merchant

Returns a list of availabiltiy for all features for merchant ID

Authorizations:
bearerAuth

Responses

Request samples

    curl -x GET https://services.inplayer.com/v2/features/merchant/{id}
    -H "Authorization:Bearer <token>"

Response samples

Content type
application/json
{
  • "full_features_availiability": {
    }
}

Update features enabled for merchant

Removes all previously enabled features with strategy accountWithId for the merchant, and enables the newly specified features.

Authorizations:
bearerAuth
Request Body schema: application/x-www-form-urlencoded
feature_ids
Array of arrays

The feature IDs that should be enabeld for the specific merchant (only features with previously set strategy of "accountWithId")

Responses

Request samples

    curl -x PUT staging-v2.inplayer.com/v2/features/merchant/{id} \
    -H "Authorization:Bearer <token>" \
    -d feature_ids=1 \
    -d feature_ids=2

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully added features for account"
}