RubyPlay Public API uses HTTP Basic Authentication. Every request must include an Authorization header with Base64-encoded credentials:
Authorization: Basic <base64(username:password)>Credentials are issued by RubyPlay during integration.
Every set of credentials has a user type. It determines how many brands you can act on, which endpoint path you use, and which endpoints are available to you. Your type is returned by the /api/v1/self endpoint.
| Type | Description |
|---|---|
| INDIVIDUAL | A single brand of an operator. This is the original integration setup and the type most current integrations use. |
| PARTNER | An operator or aggregator acting on several brands with one set of credentials. |
| THIRD_PARTY | An external supplier acting on the data of the brands it has been granted. |
Most endpoints are available via two paths:
| Path | Brand |
|---|---|
/api/v1/{endpoint} | Implicit (Without brandId). The brand is resolved from your credentials. |
/api/v1/brands/{brandId}/{endpoint} | Explicit (With brandId). The brand is specified in the path. |
Which path you use depends on your user type:
| Type | Brands | Path |
|---|---|---|
| INDIVIDUAL | Exactly one | Both paths. The brand is resolved from your credentials when you omit brandId. |
| PARTNER | One or more | Explicit only. A request without brandId is rejected with 400 BRAND_REQUIRED. |
| THIRD_PARTY | One or more | Explicit only. A request without brandId is rejected with 400 BRAND_REQUIRED. |
A request for a brand your account does not cover is rejected with 403 BRAND_NOT_ALLOWED.
On each endpoint page, the Without brandId and With brandId tabs show the request for both paths.
To find out your user type and which brands your account covers, call the /api/v1/self endpoint. It returns your principalType and the brands your credentials are allowed to operate on, together with the brandId values to use in the explicit-brand path.
This endpoint describes the account you authenticate with, so it takes no brandId of its own and is available to every account.
API Call Sample:
- stagehttps://asia.stage.rubyplay.io/api/v1/self
curl -i -X GET \
-u '<username>:<password>' \
https://asia.stage.rubyplay.io/api/v1/self{ "allowedBrands": [ { "id": 1, "name": "Brand" } ], "principalType": "INDIVIDUAL" }
Response Schema:
Type of principal the account belongs to.
Use principalType to determine which endpoint path applies to your account, and the id of the brand you are acting on as the brandId in the explicit-brand path.