InPlayer Accounts 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"

V1

All operations related to accounts

Returns account information

Returns all the relevant information about a given account.

Authorizations:

Responses

200

Account details

401

Unauthorized request

404

Account Not found

get /accounts

Staging Server

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

Production Server

https://services.inplayer.com/accounts

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 21,
  • "email": "example-email@inplayer.com",
  • "full_name": "John Doe",
  • "referrer": "https://inplayer.com",
  • "metadata": { },
  • "social_apps_metadata":
    [
    ],
  • "roles":
    [
    ],
  • "completed": true,
  • "date_of_birth": 1531482438,
  • "created_at": 1531482438,
  • "updated_at": 1531482438
}

Create an account

Registers a new InPlayer account.

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

The first and last name of the merchant

username
required
string

The email address of the merchant

password
required
string <password>

Password containing minimum 8 characters

password_confirmation
required
string <password>

The same password with minimum 8 characters

type
required
string
Enum: "consumer" "merchant"

Account types: "consumer", "merchant"

grant_type
string
Enum: "password" "client_credentials" "refresh_token"

The type of grant required to gain access token

client_id
required
string <string>

The merchant's OAuth application ID

referrer
string

The request’s source URL

date_of_birth
string <date-time>

Customer's birthdate Unix timestamp; conditionally required in case the merchant has enabled the 'age verification' feature.

metadata
Array of objects

Responses

201

Successful Response

400

Bad request

403

Invalid privileges

409

Account already exists

422

Invalid input

post /accounts

Staging Server

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

Production Server

https://services.inplayer.com/accounts

Request samples

Copy
curl https://services.inplayer.com/accounts \
-d full_name="John Doe" \
-d username=john@example.com \
-d password=foobar123 \
-d password_confirmation=foobar123 \
-d type=consumer \
-d grant_type=password \
-d client_id=507d866c-4e33-445d-b027-f163d0099f54 \
-d metadata[phone]=bar

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  • "refresh_token": "def502006e2148f8751c7e7cfa58a91d7ecccdd6ac1648abe2fcf506e72729d4ca48a956ffe5a4afadd96e1e91c0d055262c66a3ce840e96e3542a33adbc657ed5b5810f87b130149308a9d73f5",
  • "account":
    {
    }
}

Deactivates an Account

Deactivates a customer account.

Authorizations:
query Parameters
customerID
integer

Account's id

Responses

200

Account deleted

400

Account already deactivated

401

Unauthorized

404

Account not found

delete /accounts

Staging Server

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

Production Server

https://services.inplayer.com/accounts

Request samples

Copy
curl -X DELETE https://services.inplayer.com/accounts \
  -H "Authorization: Bearer <token>"

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "string",
  • "errors":
    {
    }
}

Updates account

Updates an account.

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

The account ID of a customer, necessary for the merchant to pass it in when updating a customer’s account.

full_name
required
string

The full name of the account

referrer
string

The request’s source URL

date_of_birth
string <date-time>

Customer's birthdate Unix timestamp conditionally required in case if the merchant has enabled the 'age verification' feature.

metadata
Array of objects

Responses

200

Account updated

400

Account not found

401

Unauthorized

422

Invalid input

put /accounts

Staging Server

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

Production Server

https://services.inplayer.com/accounts

Request samples

Copy
curl -X PUT https://services.inplayer.com/accounts \
-H "Authorization: Bearer <token>" \
-d full_name="Jane Doe" \
-d metadata[foo]=bar

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": 404,
  • "message": "Account not found"
}

Request account activation

Starts the account activation process by sending an email containing the activation token and link for the account activation.

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

The account’s email address

merchant_uuid
required
string <uuid>

The universal unique identifier from the account

Responses

201

Please check your email for your account activation code

412

The account is already active

422

Account cannot be activated

post /accounts/activate

Staging Server

https://staging-v2.inplayer.com/accounts/activate

Production Server

https://services.inplayer.com/accounts/activate

Request samples

Copy
curl https://services.inplayer.com/accounts/activate \
-d email=john@example.com \
-d merchant_uuid=528b1b80-5868-4abc-a9b6-4d3455d719c8

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "Please check your email for your account activation code.",
  • "code": 201
}

Activates an account

path Parameters
token
required
string

The activation token

Responses

200

Successful operation

422

Invalid input

put /accounts/activate/{token}

Staging Server

https://staging-v2.inplayer.com/accounts/activate/{token}

Production Server

https://services.inplayer.com/accounts/activate/{token}

Request samples

Copy
curl -X PUT https://services.inplayer.com/accounts/activate/{token}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": 422,
  • "message": "The account could not be activated"
}

Get all followers

Returns all the followers created by the logged in (master) account.

Authorizations:

Responses

200

Followers details

400

Invalid input

403

Invalid privileges

get /accounts/all/follower

Staging Server

https://staging-v2.inplayer.com/accounts/all/follower

Production Server

https://services.inplayer.com/accounts/all/follower

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Authenticates Account

Authenticates an account by creating an access token that can be used for future requests.

Request Body schema: application/x-www-form-urlencoded
One of
  • Password
  • Client credentials
  • Refresh token
username
required
string

The email address of the account, in case the grant type is password.

password
required
string <password>

The account password, in case the grant type is password

grant_type
required
string
Enum: "password" "client_credentials" "refresh_token"

With the grant type you can switch between authentication types.

client_id
required
string

The Merchant's OAuth application ID

Responses

201

Successful Response

403

Invalid Credentials

409

Inactive account

422

Invalid input

post /accounts/authenticate

Staging Server

https://staging-v2.inplayer.com/accounts/authenticate

Production Server

https://services.inplayer.com/accounts/authenticate

Request samples

Copy
curl https://services.inplayer.com/accounts/authenticate \
  -d client_id="528b1b80-5868-4abc-a9b6-4d3455d719c8" \
  -d grant_type=client_credentials \
  -d client_secret=foobared

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  • "refresh_token": "swKbldciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adWAdzCa",
  • "account":
    {
    }
}

Change password

Replaces the account's password with a new one.

Authorizations:
Request Body schema: application/x-www-form-urlencoded
password
required
string <password>

The account's new password.

password_confirmation
required
string <password>

The account's new password, required for confirmation.

old_password
required
string <password>

The account's old password.

Responses

200

Successful operation

401

Unauthorized

422

Invalid input

post /accounts/change-password

Staging Server

https://staging-v2.inplayer.com/accounts/change-password

Production Server

https://services.inplayer.com/accounts/change-password

Request samples

Copy
curl https://services.inplayer.com/accounts/change-password \
      -H 'Authorization:Bearer <Access-Token>' \
      -d old_password=foo \
      -d password=secret \
      -d password_confirmation=secret

Response samples

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

Erase an account

Erases an account (and all the all personal details contained) permanently.

Authorizations:
query Parameters
customer_id
required
integer

The ID of the customer account (if the operation has been invoked by a merchant)

password
required
string

Password confirmation

Responses

204

Account successfully erased

400

Account already erased

401

Unauthorized

404

Account not found

delete /accounts/erase

Staging Server

https://staging-v2.inplayer.com/accounts/erase

Production Server

https://services.inplayer.com/accounts/erase

Request samples

Copy
curl -X DELETE https://services.inplayer.com/accounts/erase \
  -H 'Authorization:Bearer <Access-Token>' \
  -d password=foobar

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": 400,
  • "message": "The account does not exist"
}

Export Account Data