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

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 accounts

Returns account information

Returns all relevant information about the logged in 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

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

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

The full name of the account

username
required
string
password
required
string <password>
password_confirmation
required
string <password>
type
required
string
Enum:"consumer" "merchant"
grant_type
string
Enum:"password" "client_credentials" "refresh_token"
client_id
required
string <string>
referrer
string
date_of_birth
string <date-time>

Conditionally required in case if the merchant has enabled the 'age verification' feature.

metadata
Array of object

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

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

Deactivates an Account

Deactivates consumer 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

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

Updates account

Updates account

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

Account ID needs to be passed in case a Merchant want to update some of his consumer accounts.

full_name
required
string

The full name of the account

referrer
string
date_of_birth
string <date-time>

Conditionally required in case if the merchant has enabled the 'age verification' feature.

metadata
Array of object

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

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

Request account activation

Starts the account activation process. Sends an email with activation token and link for account activation.

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

Account email.

merchant_uuid
required
string <uuid>

the uuid 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

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

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

Get all followers

Returns all followers created by the logged in 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

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

Authenticates Account

Oauth authentication. This method will create access_token for the future signed requests in the name of the account.

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 grant type is password.

password
required
string <password>

The account password, in case 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

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

Changes password

Updates the account's password.

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

The new password for the account.

password_confirmation
required
string <password>

Password confirmation.

old_password
required
string <password>

Account's old password for confirmation.

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

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

Erase account

Complete erasure of an account with all personal details removed.

Authorizations:
query Parameters
customer_id
required
integer

The ID of the customer account if the operation is called 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

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

Export Account Data

Exports account data such as logins, payments, subscriptions, access to assets etc. After invoking the request the account will receive the data in a json format via e-mail.

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

Password of the current logged user

Responses

200

Successful Response

403

Invalid credentials

404

Account not found

422

Unprocessable entty

post /accounts/export
Staging Server
https://staging-v2.inplayer.com/accounts/export
Production Server
https://services.inplayer.com/accounts/export

Request samples

Copy
curl -X POST https://services.inplayer.com/accounts/export \
  -H 'authorization: Bearer Access-Token' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d password=123456 \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "message": "Your data has been successfully exported. You will receive an email shortly.",
  • "code": 200
}

Creates forgot password token

The first step in change password functionality. After this call, on your email address you will recieve a valid token for password reset. Then you will need to complete the change password operation with the provided token.

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

The UUID of the parent merchant account

email
required
string

The email address of the account.

Responses

200

Successful operation

422

Invalid input

post /accounts/forgot-password
Staging Server
https://staging-v2.inplayer.com/accounts/forgot-password
Production Server
https://services.inplayer.com/accounts/forgot-password

Request samples

Copy
curl https://services.inplayer.com/accounts/forgot-password \
  -d email=example@mail.com \
  -d merchant_uuid="507d866c-4e33-445d-b027-f163d0099f54"

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Please check your email"
}

Updates password

Using the generated forgot password token, you can call this method to update your password.

path Parameters
token
required
string

The generated token sent to your email address

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

The new password of the account.

password_confirmation
required
string <password>

The password confirmation.

branding_id
integer

optional branding ID in case branding themes feature is used

Responses

200

Successful operation

422

Invalid input

put /accounts/forgot-password/{token}
Staging Server
https://staging-v2.inplayer.com/accounts/forgot-password/{token}
Production Server
https://services.inplayer.com/accounts/forgot-password/{token}

Request samples

Copy
curl -X PUT https://services.inplayer.com/accounts/forgot-password/{token} \
      -d password=secret \
      -d password_confirmation=secret

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 422,
  • "message": "Invalid input",
  • "errors":
    {
    }
}

Impersonate

Login as one of master's followers

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

Follower's account id

uuid
required
string

Merchant's uuid of the follower

client_id
required
string
email
required
string

Email address of the follower you want to log in

grant_type
required
string
password
required
string

Password of the current logged user

Responses

200

Successful Response

400

Not Found

404

Bad request

422

Invalid input

post /accounts/impersonate
Staging Server
https://staging-v2.inplayer.com/accounts/impersonate
Production Server
https://services.inplayer.com/accounts/impersonate

Request samples

Copy
curl -X POST https://services.inplayer.com/accounts/impersonate \
  -H 'authorization: Bearer Access-Token' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d sign_in_as=123 \
  -d email="john@example.com" \
  -d grant_type="social" \
  -d client_id="528b1b80-5868-4abc-a9b6-4d3455d719c8" \
  -d uuid="528b1b80-5868-4abc-a9b6-4d3455d719c8&password=inplayer123" \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "master_id": 21,
  • "follower_id": 123,
  • "scopes":
    [
    ],
  • "created_at": 1531482438
}

Sign out

Account logout

Authorizations:

Responses

200

Operation Successful

401

Unauthorized

get /accounts/logout
Staging Server
https://staging-v2.inplayer.com/accounts/logout
Production Server
https://services.inplayer.com/accounts/logout

Request samples

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

Response samples

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

Creates follower merchant account

Creates follower merchant account that can inherit merchant settings aditionaly.

Authorizations:
Request Body schema: application/x-www-form-urlencoded
One of
  • With existing account
  • With new account
follower_id
integer

Account ID from the follower merchant in case the account alreeady exists.

scopes
Array of string
methods
Array of object

Set which methods should be active/inactive.

Responses

201

Successful Response

400

Bad request

401

Unauthorized

403

Invalid privileges

409

Account already exists

422

Invalid input

post /accounts/merchants
Staging Server
https://staging-v2.inplayer.com/accounts/merchants
Production Server
https://services.inplayer.com/accounts/merchants

Request samples

Copy
curl -X POST https://services.inplayer.com/accounts/merchants \
  -H 'authorization: Bearer Access-Token' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d full_name="John Doe" \
  -d email="john@example.com" \
  -d password="foobar123" \
  -d master_id=123 \
  -d scopes[0]="inheritance" \
  -d methods[12]=true \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "access_token": "eyJhbGciOiJIUzI1NiIsInUj6CI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  • "account":
    {
    }
}

Update master-follower relation

Update master-follower scopes

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

Follower's account id

scopes
required
Array of string
methods
Array of object

Set which methods should be active/inactive.

Responses

200

Successful Response

400

Invalid input

404

Bad request

409

This account already exists

422

Invalid input

put /accounts/merchants/relation
Staging Server
https://staging-v2.inplayer.com/accounts/merchants/relation
Production Server
https://services.inplayer.com/accounts/merchants/relation

Request samples

Copy
curl -X PUT https://services.inplayer.com/accounts/merchants/relation \
  -H 'authorization: Bearer Access-Token' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d follower_id=123 \
  -d scopes[0]="inheritance" \
  -d methods[7]=false \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "master_id": 21,
  • "follower_id": 123,
  • "scopes":
    [
    ],
  • "created_at": 1531482438
}

Get register fields

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

Merchant uuid

Responses

200

Register fields

404

Account Not found

get /accounts/register-fields/{merchant_uuid}
Staging Server
https://staging-v2.inplayer.com/accounts/register-fields/{merchant_uuid}
Production Server
https://services.inplayer.com/accounts/register-fields/{merchant_uuid}

Request samples

Copy
curl -X GET https://services.inplayer.com/accounts/register-fields/{merchant_uuid}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 44,
  • "name": "gender",
  • "label": "Gender",
  • "type": "select",
  • "required": true,
  • "default_value": "male",
  • "placeholder": "Gender",
  • "options":
    [
    ]
}

Get List of Social URLs

Returns list of social button URLs

Authorizations:
query Parameters
state
required
string
Example: "eyJjbJulbnR0dHA6Ly9sb2NskOvc3Q6ODA4MC8/aXB3PTEmYXNzZXRfaWS9sMDczNzQifQ=="

State token from the social service

Responses

200

An array of social urls

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

422

Unprocessable Entity

V2

Create an account

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

The full name of the account

password
string <password>
referrer
string
metadata
Array of object

Responses

201

Successful Response

400

Bad request

403

Invalid privileges

409

Account already exists

422

Invalid input

post /v2/accounts/customers
Staging Server
https://staging-v2.inplayer.com/v2/accounts/customers
Production Server
https://services.inplayer.com/v2/accounts/customers

Request samples

Copy
curl https://services.inplayer.com/v2/accounts/customers \
  -H 'authorization: Bearer Access-Token' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d email=john@example.com \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  • "expires": 1531482438,
  • "account":
    {
    }
}

Impersonate

Logs a merchant as different customer

Request Body schema: application/x-www-form-urlencoded
customer_id
required
int

Responses

201

Successful Response

400

Bad request

422

Invalid input

post /v2/accounts/impersonate
Staging Server
https://staging-v2.inplayer.com/v2/accounts/impersonate
Production Server
https://services.inplayer.com/v2/accounts/impersonate

Request samples

Copy
curl https://services.inplayer.com/v2/accounts/impersonate \
  -H 'authorization: Bearer Access-Token' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d customer_id=20456 \

Response samples

application/json
Copy
Expand all Collapse all
{
  • "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  • "expires": 1531482438,
  • "account":
    {
    }
}

Send pin code

Creates pin code and sends it to your email

Request Body schema: application/x-www-form-urlencoded
branding_id
int

Responses

200

Successful Response

201

Successfully Created

400

Bad request

401

Unauthorized request

post /v2/accounts/pin-codes/send
Staging Server
https://staging-v2.inplayer.com/v2/accounts/pin-codes/send
Production Server
https://services.inplayer.com/v2/accounts/pin-codes/send

Request samples

Copy
curl https://services.inplayer.com/v2/accounts/pin-codes/send
  -H "Authorization: Bearer <token>"
  -d "branding_id=1"

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "Please check your email for your pin code."
}

Validate pin code

Checks validity of pin code

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

Responses

200

Successful Response

400

Bad request

401

Unauthorized request

403

The pin does not match

post /v2/accounts/pin-codes/validate
Staging Server
https://staging-v2.inplayer.com/v2/accounts/pin-codes/validate
Production Server
https://services.inplayer.com/v2/accounts/pin-codes/validate

Request samples

Copy
curl https://services.inplayer.com/v2/accounts/pin-codes/validate
  -H "Authorization: Bearer <token>"
  -d 'pin_code=A5RS2'

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 200,
  • "message": "The pin code is valid"
}