InPlayer API (2.0.0)

Download OpenAPI specification:Download

INTRODUCTION

Our Paywall platform enables you up to create a detailed subscription business, allowing you to build a consumer base and drive significant revenues. Our paywall supports recurring payments and billing, consumer acquisition, subscriber lifecycle management and gives you 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. However, you can always integrate with our APIs for full custom integration.

INPLAYER API

The InPlayer API has REST architecture. It has mostly resource-oriented URLs, and uses standard HTTP response codes to indicate API errors or success requests. Every InPlayer Core Resource has its own URL and each operation (GET, POST, PUT, and DELETE) has a specific meaning

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

JSON is returned by all API responses, no matter if they are success or errors.

DOCS TERMINOLOGY

In the section bellow you can find explanation about the terms that are used for the Core Resources in the InPlayer Platform. Be sure to read it before you start with custom integration.

Accounts and Account Types

Term Explanation
merchant The Merchants are those that has ownership of the premium content.
consumer The Consumers are those that can view or buy the premium content.
customer Consumer with at least one purchase.
uuid Unique identifier of the Merchant. You can find it in the InPlayer dashboard in the Account Details section as Account ID.

Items/Assets and Item Types

Term Explanation
items Items or sometimes referred as Assets are the digital assets that Merchants can protect and sell. Asset is an Item with applied pricing and access options.
item_type Is the type of the digital content that can be created in the InPlayer Platform. The only difference between the Item Types is the premium content type. Currently, only available options for Item Types are html_asset where you can store HTML code or any IFRAME code, and ooyala_asset where you can store digital asset content hosted in Ooyala.
content Content of one Item is the premium content that you can store and protect. Once the Consumer has access to the Item, he can view the content.
metadata Metadata is unlimited key-value store for describing Items.

Access Types

Term Explanation
access_type Types of access that can be used in the system.
period The time frame of the asset access that the consumer get after purchasing.

Access Fees

Term Explanation
access_fee Applied access_type and price to Item.

Items Packages

Term Explanation
package Collection of multiple Items. Packages are group of Items. You can set up Package Access Fee that will be additional pricing option for the Items that belong to a Package. Once the Consumer buys Package Access Fee he will have access to every Item that belongs to the Package.

API ENVIRONMENTS

To make the API as explorable as possible, we have 2 different environments for live or testing purposes. There is no switch for changing between modes, just use the different URLs of our API servers.

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. When a request is valid but does not complete successfully (e.g., 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 missing a required parameter.
401 Unauthorized No valid access token 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 hit the API too quickly. We recommend an exponential backoff of 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"

V1

All operations related to restrictions & rules

Create global age restriction

Creates global age restriction for all items for current merchant

Authorizations:
Request Body schema: application/x-www-form-urlencoded
min_age
required
integer

Minimum age

Responses

200

OK

400

Bad Request

401

Unauthorized request

422

Unprocessable entity

post /restrictions/age
Staging Server
https://staging-v2.inplayer.com/restrictions/age
Production Server
https://services.inplayer.com/restrictions/age

Request samples

Copy
curl -X POST \
  https://services.inplayer.com/restrictions/age
  -H 'Authorization: Bearer <token>'
  -d 'min_age=18'

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Successfully created global age restriction."
}

Delete global age restriction

Delete global age restiroction for merchant

Authorizations:

Responses

200

OK

400

Bad Request

401

Unauthorized request

delete /restrictions/age
Staging Server
https://staging-v2.inplayer.com/restrictions/age
Production Server
https://services.inplayer.com/restrictions/age

Request samples

Copy
curl -X DELETE \
  'https://services.inplayer.com/restrictions/age'
  -H 'Authorization: Bearer <token>'

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Successfully deleted global age restriction"
}

Return global age restriction

Returns global age restriction

Authorizations:

Responses

200

Age Global details

401

Unauthorized

404

Not Found

get /restrictions/age
Staging Server
https://staging-v2.inplayer.com/restrictions/age
Production Server
https://services.inplayer.com/restrictions/age

Request samples

Copy
curl https://services.inplayer.com/restrictions/age
  -H "Authorization: Bearer <token>"

Response samples

application/json
Copy
Expand all Collapse all
{
  • "min_age": 18,
  • "merchant_uuid": "4a39b5ab-b5fc-4ba3-b770-73155d20e61f",
  • "created_at": 1532425425,
  • "updated_at": 1532425425
}

Return Age Restriction for Item

Returns age restriction for the item provided

Authorizations:
path Parameters
item_id
required
integer

Item ID

Responses

200

OK

401

Unauthorized

404

Not Found

406

Not Acceptable

422

Unprocessable Entity

get /restrictions/age/item/{item_id}
Staging Server
https://staging-v2.inplayer.com/restrictions/age/item/{item_id}
Production Server
https://services.inplayer.com/restrictions/age/item/{item_id}

Request samples

Copy
curl https://services.inplayer.com/restrictions/age/item/12
  -H 'Authorization: Bearer <token>'

Response samples

application/json
Copy
Expand all Collapse all
{
  • "min_age": 18,
  • "item_id": 12,
  • "merchant_id": 123,
  • "created_at": 1532425425,
  • "updated_at": 1532425425
}

Create Age Restriction for Item

Creates age restriction for the item provided

Authorizations:
path Parameters
item_id
required
integer

Item ID

Request Body schema: application/x-www-form-urlencoded
min_age
required
integer

Minimum age

Responses

200

OK

400

Bad Request

401

Unauthorized

404

Not Found

406

Not Acceptable

422

Unprocessable Entity

post /restrictions/age/item/{item_id}
Staging Server
https://staging-v2.inplayer.com/restrictions/age/item/{item_id}
Production Server
https://services.inplayer.com/restrictions/age/item/{item_id}

Request samples

Copy
curl -X POST \
   https://services.inplayer.com/restrictions/age/item/12
  -H 'Authorization: Bearer <token>'
  -d min_age=18

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Successfully created Age Restriction"
}

Delete Age Restriction for Item

Deletes age restriction for the item provided

Authorizations:
path Parameters
item_id
required
integer

Item ID

Responses

200

OK

400

Bad Request

401

Unauthorized

422

Unprocessable Entity

delete /restrictions/age/item/{item_id}
Staging Server
https://staging-v2.inplayer.com/restrictions/age/item/{item_id}
Production Server
https://services.inplayer.com/restrictions/age/item/{item_id}

Request samples

Copy
curl -X DELETE \
  'https://services.inplayer.com/restrictions/age/12'

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Successfully deleted Age Restriction"
}

Return domain restrictions per Merchant

Returns restricted domains per merchant

Authorizations:
query Parameters
domain
string

domain URL

Responses

200

Domain Global details

401

Unauthorized request

404

Account Not found

get /restrictions/domain
Staging Server
https://staging-v2.inplayer.com/restrictions/domain
Production Server
https://services.inplayer.com/restrictions/domain

Request samples

Copy
curl https://services.inplayer.com/restrictions/domain
  -H "Authorization: Bearer <token>"

Response samples

application/json
Copy
Expand all Collapse all
[]

Delete global domain

Deletes all domains or single if domain in query parameter is provided

Authorizations:
query Parameters
domain
string

domain URL

Responses

200

OK

400

Bad Request

401

Unauthorized request

delete /restrictions/domain
Staging Server
https://staging-v2.inplayer.com/restrictions/domain
Production Server
https://services.inplayer.com/restrictions/domain

Request samples

Copy
curl -X DELETE \
  'https://services.inplayer.com/restrictions/domain?domain=https://example.com' \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Resource deleted successfully"
}

Creates or updates global domain restrictions

Create or update global restricted domains

Authorizations:
path Parameters
type
required
string

Blacklist/Whitelist type

Request Body schema: application/x-www-form-urlencoded
domains
required
Array of object
example
any

Responses

200

OK

400

Bad Request

401

Unauthorized request

post /restrictions/domain/{type}
Staging Server
https://staging-v2.inplayer.com/restrictions/domain/{type}
Production Server
https://services.inplayer.com/restrictions/domain/{type}

Request samples

Copy
curl -X POST \
  https://services.inplayer.com/restrictions/domain/blacklist
  -H 'Authorization: Bearer <token>'
  -d age_verification_enabled=true \
  -d age_verification_type=pin_code


Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Resource created successfully"
}

Creates or updates domain restrictions for given asset

Create or update restricted domains per asset

Authorizations:
path Parameters
type
required
string

Blacklist/Whitelist type

item_id
required
integer

Item ID

Request Body schema: application/x-www-form-urlencoded
domains
required
Array of object
example
any

Responses

200

OK

400

Bad Request

401

Unauthorized request

post /restrictions/domain/{type}/item/{item_id}
Staging Server
https://staging-v2.inplayer.com/restrictions/domain/{type}/item/{item_id}
Production Server
https://services.inplayer.com/restrictions/domain/{type}/item/{item_id}

Request samples

Copy
curl -X POST \
  https://services.inplayer.com/restrictions/domain/blacklist/item/909
  -H 'Authorization: Bearer <token>'
  -d 'domains%5B0%5D%5Bid%5D=0&domains%5B0%5D%5Bdomain%5D=http%3A%2F%2Fexample.com'

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Resource created successfully"
}

Returns domain restrictions per item

Returns restricted domains per item

Authorizations:
path Parameters
item_id
required
integer

Item ID

query Parameters
domain
string

domain URL

Responses

200

Domain Item details

401

Unauthorized request

404

Account Not found

get /restrictions/domain/item/{item_id}
Staging Server
https://staging-v2.inplayer.com/restrictions/domain/item/{item_id}
Production Server
https://services.inplayer.com/restrictions/domain/item/{item_id}

Request samples

Copy
curl https://services.inplayer.com/restrictions/domain/item/{item_id}
  -H "Authorization: Bearer <token>"

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 14,
  • "item_id": 40494,
  • "merchant_id": 25478,
  • "domain": "https://example.com",
  • "type": "blacklist"
}

Delete asset domain

Deletes all domains or single if domain in query parameter is provided

Authorizations:
path Parameters
item_id
required
integer

Item ID

query Parameters
domain
string

domain URL

Responses

200

OK

400

Bad Request

401

Unauthorized request

delete /restrictions/domain/item/{item_id}
Staging Server
https://staging-v2.inplayer.com/restrictions/domain/item/{item_id}
Production Server
https://services.inplayer.com/restrictions/domain/item/{item_id}

Request samples

Copy
curl -X DELETE \
  -H "Authorization: Bearer <token>"
  'https://services.inplayer.com/restrictions/domain/item/909?domain=https://example.com'

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Resource deleted successfully"
}

Return all country sets per merchant

Returns all restricted country sets with countries per merchant

Authorizations:

Responses

200

Country Set details

401

Unauthorized request

404

Account Not found

get /restrictions/geo/country-set
Staging Server
https://staging-v2.inplayer.com/restrictions/geo/country-set
Production Server
https://services.inplayer.com/restrictions/geo/country-set

Request samples

Copy
curl -X GET \
  https://services.inplayer.com/restrictions/geo/country-set
    -H 'Authorization: Bearer <token>' \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries":
    [
    ],
  • "created_at": 1532425425
}

Create new Country Set

Creates new country set with countries

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

Country Set name

global
required
boolean

Sets country set global if 1.

type
required
string

Restriction Type. Can be 'blacklist' or 'whitelist'

countries
required
Array of object (CountrySetList)

Responses

200

OK

400

Bad Request

401

Unauthorized request

post /restrictions/geo/country-set
Staging Server
https://staging-v2.inplayer.com/restrictions/geo/country-set
Production Server
https://services.inplayer.com/restrictions/geo/country-set

Request samples

Copy
curl -X POST \
  https://services.inplayer.com/restrictions/geo/country-set
  -H 'Authorization: Bearer <token>' \
  -d 'global=0&name=ExampleName&countries%5B%5D=MK&countries%5B%5D=BR&type=whitelist'

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries":
    [
    ],
  • "created_at": 1532425425
}

Return country set with countries

Returns country set with countries for given set id

Authorizations:
path Parameters
country_set_id
required
integer

Country Set ID

Responses

200

Country Set details

401

Unauthorized request

404

Account Not found

get /restrictions/geo/country-set/{country_set_id}
Staging Server
https://staging-v2.inplayer.com/restrictions/geo/country-set/{country_set_id}
Production Server
https://services.inplayer.com/restrictions/geo/country-set/{country_set_id}

Request samples

Copy
curl -X GET \
  https://services.inplayer.com/restrictions/geo/country-set/1
    -H 'Authorization: Bearer <token>' \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries":
    [
    ],
  • "created_at": 1532425425
}

Edit Country Set

Edits country set with countries

Authorizations:
path Parameters
country_set_id
required
integer

Country Set ID

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

Country Set name

global
required
boolean

Sets country set global if 1.

type
required
string

Restriction Type. Can be 'blacklist' or 'whitelist'

countries
required
Array of object (CountrySetList)

Responses

200

OK

400

Bad Request

401

Unauthorized request

put /restrictions/geo/country-set/{country_set_id}
Staging Server
https://staging-v2.inplayer.com/restrictions/geo/country-set/{country_set_id}
Production Server
https://services.inplayer.com/restrictions/geo/country-set/{country_set_id}

Request samples

Copy
curl -X PUT \
  https://services.inplayer.com/restrictions/geo/country-set/21
  -H 'Authorization: Bearer <token>' \
  -d 'name=ExampleName&type=blacklist&global=1&countries%5B%5D=MK'

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries":
    [
    ],
  • "created_at": 1532425425
}

Delete Country Set

Deletes the given country set

Authorizations:
path Parameters
country_set_id
required
integer

Country Set ID

Responses

200

OK

400

Bad Request

401

Unauthorized request

delete /restrictions/geo/country-set/{country_set_id}
Staging Server
https://staging-v2.inplayer.com/restrictions/geo/country-set/{country_set_id}
Production Server
https://services.inplayer.com/restrictions/geo/country-set/{country_set_id}

Request samples

Copy
curl -X DELETE \
  https://services.inplayer.com/restrictions/geo/country-set/6
    -H 'Authorization: Bearer <token>' \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Resource deleted successfully"
}

Remove Country from Country Set

Deletes the given country from the country set provided

Authorizations:
path Parameters
country_set_id
required
integer

Country Set ID

country_name
required
string

Country name ISO

Responses

200

OK

400

Bad Request

401

Unauthorized request

delete /restrictions/geo/country-set/{country_set_id}/country/{country_name}
Staging Server
https://staging-v2.inplayer.com/restrictions/geo/country-set/{country_set_id}/country/{country_name}
Production Server
https://services.inplayer.com/restrictions/geo/country-set/{country_set_id}/country/{country_name}

Request samples

Copy
curl -X DELETE \
  https://services.inplayer.com/restrictions/geo/country-set/3/country/Macedonia111only%20because%20is%20mandatory%202222
  -H 'Authorization: Bearer <token>' \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Resource deleted successfully"
}

Set Country set for Asset

Sets the given country set to the given asset

Authorizations:
path Parameters
country_set_id
required
integer

Country Set ID

item_id
required
integer

Item ID

Responses

200

OK

400

Bad Request

401

Unauthorized request

post /restrictions/geo/country-set/{country_set_id}/item/{item_id}
Staging Server
https://staging-v2.inplayer.com/restrictions/geo/country-set/{country_set_id}/item/{item_id}
Production Server
https://services.inplayer.com/restrictions/geo/country-set/{country_set_id}/item/{item_id}

Request samples

Copy
curl -X POST \
  https://services.inplayer.com/restrictions/geo/country-set/1/item/909
  -H 'Authorization: Bearer <token>' \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries":
    [
    ],
  • "created_at": 1532425425
}

Update Country set for Asset

Updates the given country set to the given asset

Authorizations:
path Parameters
country_set_id
required
integer

Country Set ID

item_id
required
integer

Item ID

Responses

200

OK

400

Bad Request

401

Unauthorized request

put /restrictions/geo/country-set/{country_set_id}/item/{item_id}
Staging Server
https://staging-v2.inplayer.com/restrictions/geo/country-set/{country_set_id}/item/{item_id}
Production Server
https://services.inplayer.com/restrictions/geo/country-set/{country_set_id}/item/{item_id}

Request samples

Copy
curl -X PUT \
  https://services.inplayer.com/restrictions/geo/country-set/1/item/909 \
  -H 'Authorization: Bearer <token>' \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries":
    [
    ],
  • "created_at": 1532425425
}

Remove Country Set for Asset

Removes the given country set for the asset provided

Authorizations:
path Parameters
item_id
required
integer

Item ID

Responses

200

OK

400

Bad Request

401

Unauthorized request

delete /restrictions/geo/country-set/item/{item_id}
Staging Server
https://staging-v2.inplayer.com/restrictions/geo/country-set/item/{item_id}
Production Server
https://services.inplayer.com/restrictions/geo/country-set/item/{item_id}

Request samples

Copy
curl -X DELETE \
  https://services.inplayer.com/restrictions/geo/country-set/item/41948
    -H 'Authorization: Bearer <token>' \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Resource deleted successfully"
}

Return Country Set for Asset

Returns the country set for given asset

Authorizations:
path Parameters
item_id
required
integer

Item ID

Responses

200

Country Set details

401

Unauthorized request

404

Account Not found

get /restrictions/geo/items/{item_id}/country-set
Staging Server
https://staging-v2.inplayer.com/restrictions/geo/items/{item_id}/country-set
Production Server
https://services.inplayer.com/restrictions/geo/items/{item_id}/country-set

Request samples

Copy
curl -X GET \
   https://services.inplayer.com/restrictions/geo/items/42297/country-set
  -H 'Authorization: Bearer <token>' \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 1,
  • "merchant_id": 25478,
  • "name": "Country Set 1",
  • "type": "blacklist",
  • "global": true,
  • "countries":
    [
    ],
  • "created_at": 1532425425
}

Creates or updates restriction settings for given merchant

Create or update restriction settings per merchant

Authorizations:
Request Body schema: application/x-www-form-urlencoded
age_verification_enabled
required
bool
age_verification_type
required
string

Age Verification Type. Can be 'pin_code' or 'basic'

merchant_uuid
required
string

Merchant's uuid

Responses

200

OK

400

Bad Request

patch /restrictions/settings
Staging Server
https://staging-v2.inplayer.com/restrictions/settings
Production Server
https://services.inplayer.com/restrictions/settings

Request samples

Copy
curl -X PATCH \
  https://services.inplayer.com/restrictions/settings
  -H 'Authorization: Bearer <token>'
  -d age_verification_enabled=true \
  -d age_verification_type=pin_code \
  -d merchant_uuid=6y79b5ab-b5fc-4ba3-b770-73155d20e61f


Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Resource created/updated successfully"
}

Return restriction settings per Merchant

Returns restriction settings per merchant

Authorizations:
path Parameters
merchant_uuid
required
string <uuid>

Merchant's uuid

Responses

200

Restriction Settings details

400

Bad Request

404

Not Found

get /restrictions/settings/{merchant_uuid}
Staging Server
https://staging-v2.inplayer.com/restrictions/settings/{merchant_uuid}
Production Server
https://services.inplayer.com/restrictions/settings/{merchant_uuid}

Request samples

Copy
curl https://services.inplayer.com/restrictions/settings/3b39b5ab-b5fc-4ba3-b770-73155d20e61f
  -H "Authorization: Bearer <token>"

Response samples

application/json
Copy
Expand all Collapse all
{
  • "age_verification_type": "pin_code",
  • "age_verification_enabled": true,
  • "merchant_uuid": "3b39b5ab-b5fc-4ba3-b770-73155d20e61f",
  • "created_at": 1532425425,
  • "updated_at": 1532425425
}