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 branding

Creates brand theme

Creates brand to be used as a theme for the paywall and email templates.

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

The name of the brand

paywall_cover_photo
required
string

URL for the paywall preview cover photo

paywall_brand_logo
required
string

URL for the paywall brand logo

paywall_primary_color
required
string

hexadecimal value for the primary color of the paywall

paywall_secondary_color
required
string

hexadecimal value for the secondary color of the paywall

paywall_buttons_bg_color
required
string

hexadecimal value for the buttons primary color of the paywall

paywall_buttons_text_color
required
string

hexadecimal value for the buttons text color of the paywall

preview_top_border
required
boolean

Boolean value used to hide/show the top border of the preview

inplayer_protected_label
required
boolean

Boolean value used to hide/show the "protected by Inplayer" label

paywall_footer
required
string

Custom html for the paywall footer

default
boolean

Default brand for the merchant

Responses

201

Created brand

401

Unauthorized

403

Invalid privileges

422

Cannot create resource

post /branding/paywall
Staging Server
https://staging-v2.inplayer.com/branding/paywall
Production Server
https://services.inplayer.com/branding/paywall

Request samples

Copy
curl -X POST https://services.inplayer.com/branding/paywall \
    -H 'Authorization: Bearer Access-Token' \
    -d paywall_cover_photo=img-url.jpg \
    -d paywall_primary_color=#FFF \
    -d paywall_secondary_color=#000 \
    -d paywall_buttons_bg_color=#000 \
    -d paywall_buttons_text_color=#000 \
    -d preview_top_border=true \
    -d preview_buttons_bg_color=#000 \
    -d preview_buttons_text_color=#000 \
    -d inplayer_protected_label=true

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 12
}

Updates a brand theme

Authorizations:
path Parameters
id
required
integer

Brand id

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

The name of the brand

paywall_cover_photo
required
string

URL for the paywall preview cover photo

paywall_brand_logo
required
string

URL for the paywall brand logo

paywall_primary_color
required
string

hexadecimal value for the primary color of the paywall

paywall_secondary_color
required
string

hexadecimal value for the secondary color of the paywall

paywall_buttons_bg_color
required
string

hexadecimal value for the buttons primary color of the paywall

paywall_buttons_text_color
required
string

hexadecimal value for the buttons text color of the paywall

preview_top_border
required
boolean

Boolean value used to hide/show the top border of the preview

inplayer_protected_label
required
boolean

Boolean value used to hide/show the "protected by Inplayer" label

paywall_footer
required
string

Custom html for the paywall footer

default
boolean

Default brand for the merchant

Responses

200

Updated brand

401

Unauthorized

403

Invalid privileges

422

Cannot create resource

put /branding/paywall/{id}
Staging Server
https://staging-v2.inplayer.com/branding/paywall/{id}
Production Server
https://services.inplayer.com/branding/paywall/{id}

Request samples

Copy
curl -X PUT https://services.inplayer.com/branding/paywall \
    -H 'Authorization: Bearer <token>' \
    -d paywall_cover_photo=img-url.jpg \
    -d paywall_brand_logo=img1-url.jpg \
    -d paywall_primary_color=#000 \
    -d paywall_secondary_color=#FFF \
    -d paywall_buttons_bg_color=#000 \
    -d paywall_buttons_text_color=#000 \
    -d preview_top_border=true \
    -d preview_buttons_bg_color=#000 \
    -d preview_buttons_text_color=#000 \
    -d preview_top_border=true

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 401,
  • "message": "Invalid auth token"
}

Deletes a brand theme

Authorizations:
path Parameters
id
required
integer

Brand id

Responses

200

Deleted brand

401

Unauthorized

403

Invalid privileges

delete /branding/paywall/{id}
Staging Server
https://staging-v2.inplayer.com/branding/paywall/{id}
Production Server
https://services.inplayer.com/branding/paywall/{id}

Request samples

Copy
curl -X DELETE https://services.inplayer.com/branding/paywall/{id} \
    -H 'Authorization: Bearer <token>'

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 401,
  • "message": "Invalid auth token"
}

Get brand details

path Parameters
id
required
integer
Example: 12

Brand id

merchant_uuid
required
string <uuid>
Example: "528b1b80-5868-4abc-a9b6-4d3455d719c8"

Merchant uuid

Responses

200

Brand details

400

Brand not found

get /branding/paywall/{merchant_uuid}/{id}
Staging Server
https://staging-v2.inplayer.com/branding/paywall/{merchant_uuid}/{id}
Production Server
https://services.inplayer.com/branding/paywall/{merchant_uuid}/{id}

Request samples

Copy
curl https://services.inplayer.com/branding/paywall/{merchant_uuid}/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 14,
  • "exists": true,
  • "brand_name": "Acme Inc.",
  • "paywall_cover_photo": "string",
  • "paywall_primary_color": null,
  • "paywall_secondary_color": null,
  • "paywall_buttons_bg_color": null,
  • "paywall_buttons_text_color": null,
  • "preview_top_border": false,
  • "inplayer_protected_label": true,
  • "paywall_footer": "Foo bar",
  • "default": true
}

Get default brand details

path Parameters
merchant_uuid
required
string <uuid>
Example: "528b1b80-5868-4abc-a9b6-4d3455d719c8"

Merchant uuid

Responses

200

Brand details

400

Brand not found

get /branding/paywall/{merchant_uuid}/default
Staging Server
https://staging-v2.inplayer.com/branding/paywall/{merchant_uuid}/default
Production Server
https://services.inplayer.com/branding/paywall/{merchant_uuid}/default

Request samples

Copy
curl https://services.inplayer.com/branding/paywall/{merchant_uuid}/default

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 14,
  • "exists": true,
  • "brand_name": "Acme Inc.",
  • "paywall_cover_photo": "string",
  • "paywall_primary_color": null,
  • "paywall_secondary_color": null,
  • "paywall_buttons_bg_color": null,
  • "paywall_buttons_text_color": null,
  • "preview_top_border": false,
  • "inplayer_protected_label": true,
  • "paywall_footer": "Foo bar",
  • "default": true
}