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.

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 features.

Get list of Features Availability

Returns list of availabiltiy for all features.

Authorizations:

Responses

200

OK

401

Unauthorized

500

Unable to process the request

get /v2/features

Staging Server

https://staging-v2.inplayer.com/v2/features

Production Server

https://services.inplayer.com/v2/features

Request samples

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

Response samples

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

Add new feature

Registering new feature for enabiling/disabiling.

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

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

Responses

200

OK

400

Bad Request

401

Unauthorized

404

Not Found

422

UnprocessableEntity

500

Unable to process the request

post /v2/features

Staging Server

https://staging-v2.inplayer.com/v2/features

Production Server

https://services.inplayer.com/v2/features

Request samples

Copy
    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
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Successfully added feature"
}

Delete feature

Removes a given feature with all its connections to accounts

Authorizations:

Responses

200

OK

401

Unauthorized

404

Not Found

500

Unable to process the request

delete /v2/features/{name}

Staging Server

https://staging-v2.inplayer.com/v2/features/{name}

Production Server

https://services.inplayer.com/v2/features/{name}

Request samples

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

Response samples

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

Update feature

Recreates the entire feature.

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

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

Responses

200

OK

400

Bad Request

401

Unauthorized

404

Not Found

422

UnprocessableEntity

500

Unable to process the request

put /v2/features/{name}

Staging Server

https://staging-v2.inplayer.com/v2/features/{name}

Production Server

https://services.inplayer.com/v2/features/{name}

Request samples

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

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

Responses

200

OK

400

Bad Request

401

Unauthorized

404

Not Found

422

UnprocessableEntity

500

Unable to process the request

patch /v2/features/{name}

Staging Server

https://staging-v2.inplayer.com/v2/features/{name}

Production Server

https://services.inplayer.com/v2/features/{name}

Request samples

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

Responses

200

OK

401

Unauthorized

404

Not Found

422

UnprocessableEntity

500

Unable to process the request

get /v2/features/merchant/{id}

Staging Server

https://staging-v2.inplayer.com/v2/features/merchant/{id}

Production Server

https://services.inplayer.com/v2/features/merchant/{id}

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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:
Request Body schema: application/x-www-form-urlencoded
feature_ids
array

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

Responses

200

OK

400

Bad Request

401

Unauthorized

404

Not Found

422

UnprocessableEntity

500

Unable to process the request

put /v2/features/merchant/{id}

Staging Server

https://staging-v2.inplayer.com/v2/features/merchant/{id}

Production Server

https://services.inplayer.com/v2/features/merchant/{id}

Request samples

Copy
    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
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Successfully added features for account"
}