This property uniquely identifies a resource. Every resource of a given kind will have a unique id. Even though an id may sometimes look like a number, it should always be treated as a string.
UTC. Complete date: YYYY-MM-DD (eg 1997-07-16)
UTC. Complete date plus hours, minutes and seconds: YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30Z), compliant with http://www.w3.org/TR/NOTE-datetime.
Where:
NOTE:
Lists or search results are paginated. Pagination based on Range headers with custom range unit depends on resource.
Headers according to HTTP/1.1 RFC:
Defaults: \n * Offset: 0. \n * Max page size: 10, 20, 100, 200 or 1000 items.
Note inconsistency in RFC between formats:
Range: tracks=0-49 \n Content-Range: tracks 0-49/*
NOTES from RFC:
unit SP (first-pos ''-'' last-pos) ''/'' (instance-length | ''*'')instance-length specifies the current length of the selected resource (known number of accessible items in the collection).IMPORTANT
instance-length > last-pos + 1.instance-length >= last-pos + 1.last-pos - first-pos + 1). Example: the result can contain less than 20 tracks even if Content-Range is 40-59. Each result page can contain just part of requested range, but Content-Range header is always represents full range (correct case: request with Range 30-59 >> 2 tracks in response body + Content-Range 30-59/60).Examples:
// first search query = get first 20 tracks (20 is default value)
// NOTE: the result can contain less than 20 tracks even if Content-Range is 0-19.
Request:
GET /v2/tracks?query=gaga
Response:
206 Partial Content
Accept-Ranges: tracks
Content-Range: tracks 0-19/21 // 21>19+1 => next page exists
{ \n \t\t \"tracks\": [{},{},...] \n \t }
// get second 20 tracks (20-39 - inclusive)
// NOTE: the result can contain less than 20 tracks even if Content-Range is 20-39.
Request:
GET /v2/tracks?query=gaga
Range: tracks=20-39
Response:
206 Partial Content \n \t Accept-Ranges: tracks \n\t Content-Range: tracks 20-39/41 // 41>39+1 => next page exists \n\t {...}
// get third 20 tracks (40-59 - inclusive)
// NOTE: the result can contain less than 20 tracks even if Content-Range is 40-59.
Request:
GET /v2/tracks?query=gaga
Range: tracks=40-59
Response:
206 Partial Content
Accept-Ranges: tracks
Content-Range: tracks 40-59/61 // 61>59+1 => next page exists \n\t {...}
// error: invalid range
Request:
GET /v2/tracks?query=gaga
Range: tracks=1000-999
Response:
416 Requested Range Not Satisfiable
{}
X-User-Id (optional) Beat User ID. MUST be included into each authenticated request to Beat API on behalf of end user. Needed for request routing, but not for authentication.X-Client-Id (optional) Header can be used for request routing as well as for providing client-specific data. Header should be included into each request.X-Country (optional) Some data (products, catalog metadata) can be country-specific, client may provide country code in the header. Format: a two-letter code according to (ISO 3166-1 alpha-2)[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2]X-Include (optional) Specify which additional sub-objects to include in aresponse. The value is a comma-separated list of object names. Valid names are: release-reviews, release-tracks, release-notes, release-prices, track-prices, group-releases, group-bannersX-Release-Cover-Sizes (optional) Header specifies sizes for Release cover basic objects. See Basic response objects section for details.X-Artist-Image-Sizes (optional) Header specifies sizes for Artist image basic objects. See Basic response objects section for details.X-Actor-Image-Sizes (optional) Header specifies sizes for Actor image objects. See Basic response objects section for details.X-Audio-Formats deprecated in favour of X-Stream-FormatsX-Stream-Formats (optional) Header specifies stream quality. See v2/streams/online and v2/streams/offline for details. The value is a comma-separated list of object names. Valid names are: */high, */normal, */low, h264/*.X-Shop (optional) A shop is a named group of catalog metadata, mainly releases and tracks. Several endpoints support filtering on shops. In this case, if a a shop filter is specified, the entity is only returned if the release is actually a member of that shop – otherwise, 404 is returned. If a shop is not specified, the entity can always be returned as long as it has not been taken down OR it falls back to default shop. Default shop and list of supported shops are service specific. Special value X-Shop: all specifies not filtering on shops at all and not using the default shop.Response body is JSON-encoded.
Root object of response is a namespace for keys (always a hash, not an array):
{tracks:[{track:{...}}, {track:{...}}]} // no
{tracks:[{...}, {...}]} // yes
{title: 'value'} // no \n {track: {title:'value'}} // yes
400 Bad Request - Invalid input parameter. Error message should indicate which one and why.401 Unauthorized - Bad or expired token. This can happen if the user or Beat revoked or expired an access token. To fix, you should re-authenticate the user.403 Forbidden - Bad OAuth request. Check request signature, timestamp, etc.404 Not Found - Requested resource/object is not exists.405 Method Not Allowed - Request method not expected (generally should be GET or POST).5xx Server error. Check status page or report a bug.{
"error": "exception", // required
"error_description": {string}, // required
"error_developer": {object} // optional
}
By default, the server sends back the full representation of a resource after processing requests. For better performance, you can ask the server to send only the fields you really need and get a partial response instead.
Format of fields parameter based on XPath syntax.
Example request:
1) Option (preferred)
GET /v2/releases \n\t X-Fields: id,tracks(id,title,covers,artist/cover)
2) Option
GET /v2/releases?fields=id,tracks(id,title,covers,artist/cover) \n\t NOTE: fields - must be URL encoded
HTTP 400 Bad Request - if fields query parameter is invalid
The API supports Cross Origin Resource Sharing (CORS) for AJAX requests.
Here’s a sample request sent from a browser hitting http://example.com:
$ curl -i https://api.beat.no -H \"Origin: http://example.com\"
HTTP/1.1 302 Found \n Location: https://developer.beat.no
Any domain that is registered as an OAuth Application is accepted. Here’s a sample request for a browser hitting beat.no web app:
$ curl -i https://api.beat.no -H \"Origin: http://beat.no\"
HTTP/1.1 302 Found
Location: https://developer.beat.no
Access-Control-Allow-Origin: http://beat.no
Access-Control-Expose-Headers: Content-Range, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
Access-Control-Allow-Credentials: true
This is what the CORS preflight request looks like:
$ curl -i https://api.beat.no -H \"Origin: http://beat.no\" -X OPTIONS
HTTP/1.1 204 No Content
Access-Control-Allow-Origin: http://beat.no
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, X-Release-Cover-Sizes, X-Artist-Image-Sizes, X-Stream-Formats, Authorization, X-User-Id, Range
Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE
Access-Control-Expose-Headers: Content-Range, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
Access-Control-Max-Age: 86400
Access-Control-Allow-Credentials: true
Authorization is based on OAuth2. Every request must include Authorization header.
POST /v2/someresource
Authorization: Bearer <access-token> // required, example: 5aa5cf3e75fb05b1400a024e2e748b40320a4ae8
GET /v2/users?msisdn=4742424242POST /v2/users -> user_idPOST /v2/users/:user_id/migrations + {product_id=13} -> sub_idGET /v2/users?msisdn=4742424242GET /v2/users/:user_id/subscriptions?product_id=13DELETE /v2/users/:user_id/subscriptions/:sub_idGet access token
>>>
POST /v2/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=APP_ID
&client_secret=APP_SECRET
<<<
HTTP/1.1 200 OK
Content-Type: application/json
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"expires_in":3600,
"token_type":"bearer",
"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA" // optional
}
Following requests to API resources should include Authorization header.
POST v2/resource
Authorization: Bearer <access-token>
>>>>
POST /v2/users
{
"msisdn": {string}, // optional
"firstname": {string}, // optional
"lastname": {string}, // optional
"email": {string}, // optional
}
<<<<
409 Conflict - if msisdn is already registered
{}
201 Created
{
"user": {User}
}
>>>
POST /v2/users/:user_id/migrations
{
"product_id": {string},
"renewable": {boolean} // optional, defaults to true, whether new subscription should renew or not
}
<<<<
201 Created // success, activated
{}
>>>
GET /v2/users/:user_id/subscriptions
<<<
206 Partial Content
{
"subscriptions": [{Subscription}]
}
>>>
PATCH /v2/users/:user_id/subscriptions/:subscription_id
{
"state": {int}
}
<<<
200 OK // success
{
"subscription": {
"expiry_date": {datetime|null},
"next_billing_date": {datetime|null},
"state": {int}
...
}
}
Use one of the following state values:
3 to resume stopped subscription6 to stop subscription, it will expire in the end of period>>>
DELETE v2/users/:user_id/subscriptions/:subscription_id
<<<
200 OK // success, deactivated
{}
For now, a role filter has to be specified.
Actors with the current role in at least one of the currently live releases in the catalog are returned. Role can be the name of any role known to exist in the catalog. If it does not exist, an empty collection is returned. Significant roles includes:
| role required | string |
| X-Actor-Image-Sizes | string |
| Range | string |
{- "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
]
}| artist_id required | string |
| X-Artist-Image-Sizes | string |
{- "artist": {
- "id": "string",
- "name": "string",
- "url": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "favourite": true,
- "favouritees_count": 0,
- "releases": {
- "top": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}, - "tracks": {
- "top": [
- {
- "id": "string",
- "title": "string",
- "subtitle": "string",
- "duration": 0,
- "duration_iso": "PT23M15.3S",
- "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "favourite": true
}
]
}
}
}Favourite / unfavourite artist
Assume the operation is always a success.
Add any custom HTTP headers (like for the GET request, ex: X-Release-Cover-Sizes, X-Artist-Image-Sizes and others) in order to receive necessary data in the response.
Server logic:
IMPORTANT PATCH request is responsible for merging object received from client and object stored on server. Server resolves conflicts if there is any. The response from PATCH will contain the ,merged version of the object in that case. See User Changes API for the details.
| artist_id required | string |
| X-Artist-Image-Sizes | string |
| X-Base-Change | integer base change id, defaults to 0 server side |
| X-Change-Timestamp | string time of change in UTC, defaults to current time on the backend |
| favourite | boolean |
{- "favourite": true
}{- "artist": {
- "id": "string",
- "name": "string",
- "url": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "favourite": true,
- "favouritees_count": 0,
- "releases": {
- "top": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}, - "tracks": {
- "top": [
- {
- "id": "string",
- "title": "string",
- "subtitle": "string",
- "duration": 0,
- "duration_iso": "PT23M15.3S",
- "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "favourite": true
}
]
}
}
}Fetch artist biography, link to the full biography and additional artist image.
| artist_id required | string |
{- "bio": {
- "summary": "string",
- "content": "string",
- "url": "string",
- "source": "beat"
}
}Authorization: Requires editorial admin token.
| artist_id required | string |
| content required | string full text of artist biography |
{- "content": "string"
}{- "bio": {
- "summary": "string",
- "content": "string",
- "url": "string",
- "source": "beat"
}
}Response can be paginated based on Range headers.
| query required | string |
| Range | string artists=20-39 (inclusive) |
| X-Artist-Image-Sizes | string |
{- "artists": [
- {
- "id": "string",
- "name": "string",
- "url": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "favourite": true
}
]
}Pagination: 0-20
Authorization: User token or App token
| X-Artist-Image-Sizes | string |
| Range | string |
{- "artists": [
- {
- "id": "string",
- "name": "string",
- "url": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "favourite": true
}
]
}Authorization: Requires editorial admin token.
| X-Artist-Image-Sizes | string |
required | Array of objects (id_object) |
{- "artists": [
- {
- "id": "string"
}
]
}{- "artists": [
- {
- "id": "string",
- "name": "string",
- "url": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "favourite": true
}
]
}Response can be paginated based on Range headers.
| artist_id required | string |
| types | string comma-separated list or release types, it may include shortened
(see Release API for details) |
| role | string filers releases on actor role |
| Range | string |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Includes | string |
{- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}Response can be paginate based on Range headers.
| artist_id required | string |
| role | string filters tracks on actor role |
| Range | string |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
{- "tracks": [
- {
- "id": "string",
- "title": "string",
- "subtitle": "string",
- "duration": 0,
- "duration_iso": "PT23M15.3S",
- "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "favourite": true
}
]
}API implements OAuth 2.0 protocol for authentication.
Each request to API resources requires an access_token. There are a few ways to get access token depending on client type.
Mobile Apps or Web Apps use authentication by username/password.
IMPORTANT. The duration of access_token, refresh_token, scope is unspecified and can be changed at any time. So clients have to expect any duration at any moment in the future (i.e. data type should be considered as a TEXT in terms of SQL).
Flow: 4.3 Resource Owner Password Credentials Grant.
NOTE: Authentication by user password is an exceptional case and such flow should only be enabled for selected applications. All other the third-party applications MUST use another ways described below.
Request:
POST /v2/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=password
&username=<msisdn|email>
&password=<password>
&client_id=APPLICATION_ID
&client_secret=APPLICATION_SECRET
Response:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"expires_in":3600,
"token_type":"example", // bearer
"scope": "" // optional
"refresh_token":"tGzv3JOkF0XG5Qx2TlKWI\", // optional
"user_id":"5667asdf" // optional, beat user id - included if access_token generated for authenticated user
}
Issue new access token based on signed MSISDN. Used to support Web App's passwordless login for Gakk Media (Robi Web App and others).
SECURITY NOTE: Enabled for Bangladesh phone numbers only at the moment.
SECURITY NOTE: Signature can only be generated by nginx based on specific authorization headers provided by carrier's networks. It makes possible to login to the app without typing of password. See nginx configuration for signature generation procedure.
Request:
POST /v2/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=signed_msisdn
&msisdn=8801600000199
&msisdn_signature=87r1uhasdyfp13jskfd
&client_id=APPLICATION_ID
&client_secret=APPLICATION_SECRET
Response:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"token_type":"example",
"expires_in":3600,
"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA",
"user_id":"5667asdf" // beat user id
}
Request:
POST /v2/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=coupon
&code=test1
&client_id=APPLICATION_ID
&client_secret=APPLICATION_SECRET
Response:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"token_type":"example",
"expires_in":3600,
"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA",
"user_id":"5667asdf" // beat user id
}
Code can be generated and optionally send to customer by POST v2/codes.
Request:
POST /v2/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=verification_code
&msisdn=0029133437595305 // optional, one of msisdn or user_id should present
&user_id=1111 // optional, one of msisdn or user_id should present
&code=1234
&client_id=APPLICATION_ID
&client_secret=APPLICATION_SECRET
Response:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"token_type":"example",
"expires_in":3600,
"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA",
"user_id":"5667asdf" // beat user id
}
Clone user token for the usage by the new client.
The grant_type=clone_token can be used to issue new access_token for the new client based on access_token issued by the different client (both clients are from the same project). The new issued access_token will always have the same associated user_id.
NOTE: Use grant_type=refresh_token to issue access_token for the same client.
Request:
POST /v2/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=clone_token
&access_token=2YotnFZFEjr1zCsicMWpAA // access token issued with another client credentials from the same project
&client_id=APPLICATION_ID
&client_secret=APPLICATION_SECRET
Response:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"087fashf34h7adysfy", // new token with the same user_id
"expires_in":3600,
"token_type":"example", // bearer
"scope": "" // optional
"refresh_token":"dfq4lajw78152345sfga", // optional
"user_id":"5667asdf" // optional, beat user id - included if access_token generated for authenticated user
}
Request:
POST /v2/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=account_user
&access_token=<access_token> // access token of one of account users (profiles)
&user_id=<target_user_id> // id of target profile-user within the same account
&client_id=APPLICATION_ID
&client_secret=APPLICATION_SECRET
Response:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"087fashf34h7adysfy", // new token with the same user_id
"expires_in":3600,
"token_type":"example", // bearer
"scope": "" // optional
"refresh_token":"dfq4lajw78152345sfga", // optional
"user_id":"5667asdf" // optional, beat user id - included if access_token generated for authenticated user
}
This option is used to authenticate by a previously-started OpenID session. The handle is a value that retrieved during the first step of this process. Use this call only after the OpenID callback is finished.
Request:
POST /v2/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=openid_handle
&handle=<handle>
&client_id=APPLICATION_ID
&client_secret=APPLICATION_SECRET
Response:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"expires_in":3600,
"token_type":"example", // bearer
"scope": "" // optional
"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA", // optional\_
"user_id":"5667asdf" // optional, beat user id - included if access_token generated for authenticated user
}
App tokens are used to make requirests to Beat APIs on behalf of an app rather than a user. This can be useful to provide "visitor mode" in the apps.
Request:
POST /v2/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=APPLICATION_ID
&client_secret=APPLICATION_SECRET
Response (the same as for grant_type=password):
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"expires_in":3600,
"token_type":"example", // bearer
"scope": "", // optional
// NOTE: no refresh_token field
}
Access tokens have a limited lifetime and can be refreshed when required without asking the user to login again to get new token.
Request:
POST /v2/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token
&refresh_token=tGzv3JOkF0XG5Qx2TlKWIA
&client_id=APPLICATION_ID
&client_secret=APPLICATION_SECRET
Response (the same as for grant_type=password):
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"expires_in":3600,
"token_type":"example", // bearer
"scope": "", // optional
"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA" // optional
}
Introduced mainly to support Google Play Install Referrer API.
There is an optional parameter to help tracking of install events. When user logs in to the app, client app may specify install_referrer string param provided by Google Play services.
IMPORTANT FOR CLIENTS: App should add install_referrer param only once and must clean it on after successful log in, so repeated log ins should not be tracked/rewarded.
Example:
Request:
POST /v2/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=password
&username=johndoe
&password=A3ddj3w
&client_id=APPLICATION_ID
&client_secret=APPLICATION_SECRET,
&install_referrer=u_12345
Response:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"expires_in":3600,
"token_type":"example", // bearer
"scope": "" // optional
"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA", // optional
"user_id":"5667asdf" // optional, beat user id - included if access_token generated for authenticated user
}
API implements OAuth 2.0 protocol
for authentication.\n\nEach request to API resources requires an access_token.
Mobile Apps or Web Apps use authentication by username and password.
User Access Tokens:
App Access Token:
| grant_type required | string type of access token |
| username | string flow: password |
| password | string flow: password |
| msisdn | string flows: [signed_msisdn, verfication_code, ] |
| msisdn_signature | string flow: signed_msisdn |
| code | string flows: [verification_code, |
| user_id | string flows: [account_user, verification_code (options for verification_code: supply user_id OR msisdn)] |
| access_token | string flows: [clone_token, account_user] |
| handle | string flow: openid_handle |
| refresh_token | string flow: refresh_token |
| scope | string ( optional ) |
| client_id | string APPLICATION_ID |
| client_secret | string APPLICATION_SECRET |
{- "example_password": {
- "summary": "Authentication by User Password",
- "value": {
- "$ref": "./response_examples.yaml#/auth_password"
}
}, - "example_msisdn": {
- "summary": "Authentication by Signed MSISDN",
- "value": {
- "$ref": "./response_examples.yaml#/auth_msisdn"
}
}, - "example_coupon": {
- "summary": "Authenticatoin by Coupon Code",
- "deprecated": true,
- "value": {
- "$ref": "./response_examples.yaml#/auth_coupon"
}
}, - "example_verfication": {
- "summary": "Authentication by Verification Code",
- "value": {
- "$ref": "./response_examples.yaml#/auth_verification"
}
}, - "example_cross_client": {
- "summary": "Cross-Client Authentication",
- "value": {
- "$ref": "./response_examples.yaml#/auth_cross_client"
}
}, - "example_account_user": {
- "summary": "Switching between Account Users",
- "value": {
- "$ref": "./response_examples.yaml#/auth_account_user"
}
}, - "example_openid": {
- "summary": "Authentication by OpenID Session Handle",
- "value": {
- "$ref": "./response_examples.yaml#/auth_openid"
}
}, - "example_client_credentials": {
- "summary": "Authentication by Client-Credentials",
- "value": {
- "access_token": "2YotnFZFEjr1zCsicMWpAA",
- "expires_in": 3600,
- "token_type": "example (bearer)",
- "scope": "( optional )"
}
}, - "example_refresh": {
- "summary": "Refreshing Tokens",
- "value": {
- "access_token": "2YotnFZFEjr1zCsicMWpAA",
- "expires_in": 3600,
- "token_type": "example (bearer)",
- "scope": "( optional )",
- "refresh_token": "tGzv3JOkF0XG5Qx2TlKWIA ( optional )"
}
}
}| partner_id required | string ID of the partner |
| redirect_url | string URL to redirect to after authentication |
{- "partner_id": "string",
- "redirect_url": "string"
}{- "context": {
- "handle": "string",
- "partner_id": "string",
- "url": "string"
}
}Inspired by:
LIMIT: max 20 subrequests allowed.
Server logic:
IMPORTANT PATCH request is responsible for merging object received from client and object stored on server. Server resolves conflicts if there is any. The response from PATCH will contain the merged version of the object in that case. See Changes API for the details.
Array of objects <= 20 items |
{- "example 1": {
- "summary": "Initial (first sign in) sync",
- "description": "get featured content \n\n get all personal data",
- "value": {
- "requests": [
- {
- "method": "GET",
- "url": "/v2/releases/featured"
}, - {
- "method": "GET",
- "url": "/v2/users/5667/releases/favourites"
}
]
}
}, - "example 2": {
- "summary": "Daily (second sign in) sync",
- "value": {
- "requests": [
- {
- "method": "GET",
- "url": "/v2/releases/featured"
}
]
}, - "description": "update featured content once per day"
}, - "example 3": {
- "summary": "Post-offline sync",
- "value": {
- "reqeusts": [
- {
- "method": "PATCH",
- "url": "/v2/release/234",
- "body": {
- "favourite": true,
- "ts": "123123"
}
}, - {
- "method": "GET",
- "url": "/v2/releases/featured"
}, - {
- "method": "GET",
- "url": "/v2/changes",
- "body": {
- "ts": "2014.12.12 12:12:12"
}
}
]
}, - "description": "- send offline ops \n - get back features content update \n - get changes since last sync"
}
}[- {
- "responses": [
- {
- "status": 201,
- "headers": {
- "Content-Range": "0-9/11"
}, - "body": {
- "id": "1234"
}
}, - {
- "status": 200,
- "body": { }
}, - {
- "status": 400,
- "body": {
- "error": "exception",
- "error_description": "Missing `query` parameter"
}
}
]
}
]Workflow to save card to user account
POST v2/billing/setupintents - get key necessary to collect card details on the client sidePOST v2/billing/paymentmethods - saves card to user accountCreate a setup intent.
Create setup intent to collect payment method (card) details on the client side. Card details then has to be exchanged to a payment method reference (tokenized) on the client. Payment method reference can be attached to a user by Payment Method API. Access level: requires user token.
| payment_type required | integer User's payment type, see User API for details |
| payment_method_subtype | string or null Enum: "card" "bancontact" "ideal" "sepa_debit" Depends on payment_type. If not set setup intent will be created for any payment subtype allowed for service. |
| product_id | string or null Required for vipps payment type. Creates agreement with information about specified product. |
| campaign_code | string or null Relevant for vipps payment type. Creates agreement with information about specified product modified by a campaign |
| redirect_url | string or null Url of a page that user will be redirected after collection payment details. Relevant for vipps, paystack and reepay. |
| cancel_url | string or null Url of a page that user will be redirected after user cancels payment. Relevant for reepay and paystack. |
object or null Optionally used to provide arguments that are unique per payment type |
{- "payment_type": 0,
- "payment_method_subtype": "card",
- "product_id": "string",
- "campaign_code": "string",
- "redirect_url": "string",
- "cancel_url": "string",
- "payment_type_args": {
- "property1": "string",
- "property2": "string"
}
}{- "client_secret": "string",
- "setup_intent": {
- "payment_type": 0,
- "reference": "string",
- "confirmation_url": "string",
- "client_secret": "string"
}
}Create a Payment Method. Saves payment method (card) to user account for later use. Access level: requires user token.
| payment_type required | integer User's payment type, see User API for details |
| reference required | string Card token/reference returned by payment gateway on the client |
{- "payment_type": 0,
- "reference": "string"
}{ }| X-Change-Timestamp | string |
All request parameters are optional, but at least one should be present.
| entity_type required | string Enum: "track" "release" "artist" |
| entity_id required | string |
| note | string user note |
| position_type | string Enum: "audio" "ebook" defaults to audio |
| position | integer required if position_type=audio, seconds since beginning of track |
| reader_position_selector | string required if position_type=ebook, EPUB CFI (Canonical Fragment Identifier) |
| reader_position_ratio | number <double> [ 0 .. 1 ] required if position_type=ebook, position as a fraction of pages read (range: 0-1) |
{- "entity_type": "track",
- "entity_id": "string",
- "note": "string",
- "position_type": "audio",
- "position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}{- "bookmark": {
- "id": "string",
- "entity_type": "track",
- "entity_id": "string",
- "added": "string",
- "note": "string",
- "position_type": "audio",
- "position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}
}{- "bookmark": {
- "id": "string",
- "entity_type": "track",
- "entity_id": "string",
- "added": "string",
- "note": "string",
- "position_type": "audio",
- "position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}
}| bookmark_id required | string |
| X-Base-Change | string |
| X-Change-Timestamp | string |
All request parameters are optional, but at least one should be present.
| note | string user note |
| position_type | string Enum: "audio" "ebook" defaults to audio |
| position | integer required if position_type=audio, seconds since beginning of track |
| reader_position_selector | string required if position_type=ebook, EPUB CFI (Canonical Fragment Identifier) |
| reader_position_ratio | number <double> [ 0 .. 1 ] required if position_type=ebook, position as a fraction of pages read (range: 0-1) |
{- "note": "string",
- "position_type": "audio",
- "position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}{- "bookmark": {
- "id": "string",
- "entity_type": "track",
- "entity_id": "string",
- "added": "string",
- "note": "string",
- "position_type": "audio",
- "position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}
}| utm_campaign required | string campaign code |
| product_id | string product id |
| Range | string |
{- "campaigns": [
- {
- "id": "string",
- "product_id": "string",
- "utm_campaign": "string",
- "rebate_price": 0,
- "rebate_interval": 0,
- "rebate_interval_unit": "string",
- "trial_interval": 0,
- "trial_interval_unit": "DAY",
- "fixed_trial_end_date": "string"
}
]
}List featured campaigns
Response can be paginated based on Range header
| Range | string |
{- "campaigns": [
- {
- "id": "string",
- "product_id": "string",
- "utm_campaign": "string",
- "rebate_price": 0,
- "rebate_interval": 0,
- "rebate_interval_unit": "string",
- "trial_interval": 0,
- "trial_interval_unit": "DAY",
- "fixed_trial_end_date": "string"
}
]
}| entity_type | string Enum: "coupon" "release" "campaign" "track" |
| entity_id | string Use commas to separate multiple IDs in the string Max: 1000 IDs |
{- "charges": [
- {
- "entity_type": "string",
- "entity_id": "string",
- "state": "string"
}
]
}Access level: Requires user or visitor token in most cases. Can also do operations behalf of a user if reason parameter is set to external_charge and the oauth scope for the request is external-charge.
| reason required | string Enum: "offlining" "coupon" "purchase" "campaign" "external_charge" "vipps_initial_charge" "vipps_renew" If set to |
| entity_type required | string Enum: "track" "release" "coupon" "campaign" "balance" |
| entity_id | string The id value for the given entity type. For instance |
| payment_type | integer Use 3 for Stripe, see: |
| source | string May be required for some payment types, ex: Stripe token for instance. |
string Email when charging unauthorized user. | |
| recipient_name | string Username for email template. |
| message | string Personal message for email template. |
| amount | integer Charge amount. |
| unit | string Enum: "XCR" "EUR" Unit of charge amount. |
{- "reason": "offlining",
- "entity_type": "release",
- "entity_id": "123",
- "payment_type": 3,
- "source": "string",
- "email": "string",
- "recipient_name": "string",
- "message": "string",
- "amount": 0,
- "unit": "XCR"
}{ }valid flag shows if coupon is valid for redemption, POST /users/:user_id/coupons/redemptions| code required | string coupon code |
| Range | string |
| X-Coupon-Offer-Image-Sizes | string |
{- "coupons": [
- {
- "id": "string",
- "code": "string",
- "interval": 6,
- "interval_unit": "MONTH",
- "valid": true,
- "used": true,
- "created": "string",
- "product_id": "string",
- "payment_state": 0,
- "payment_updated": "string",
- "balance_unit": "string",
- "balance_amount": 0,
- "renewable": true,
- "offer_id": "string",
- "name": "3 month membership",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
]
}Generate coupon based on specific offer from GET /vs/coupons/offers?type=:type. Requires user token
| offer_id required | string see |
{- "offer_id": "1234"
}{- "coupon": {
- "id": "string",
- "code": "string",
- "interval": 6,
- "interval_unit": "MONTH",
- "valid": true,
- "used": true,
- "created": "string",
- "product_id": "string",
- "payment_state": 0,
- "payment_updated": "string",
- "balance_unit": "string",
- "balance_amount": 0,
- "renewable": true,
- "offer_id": "string",
- "name": "3 month membership",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
}POST v2/coupons + offer_id for details.GET v2/users/:user_id/coupons?type=giftcard.POST v2/users/:id/charges + entity_type=coupon,entity_id=:coupon_code.POST /users/:user_id/coupons/redemptions + coupon.Optional HTTP header X-Coupon-Offer-Image-Sizes: w50,h200 in the request defines the set of fields in the image object inside the response. If this header is not present, the response will contain an empty list of images.
| type required | string type of offer - only |
| Range | string |
| X-Coupon-Offer-Image-Sizes | string |
{- "offers": [
- {
- "id": "string",
- "name": "3 month membership",
- "tagline": "string",
- "type": "giftcard",
- "price": "89000 = 890 NOK",
- "original_price": 0,
- "interval": 6,
- "interval_unit": "MONTH",
- "expiry_interval": 0,
- "expiry_interval_unit": "DAY",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
]
}Personal recommendations and general events
| X-Actor-Image-Sizes | string |
| X-Artist-Image-Sizes | string |
| X-Release-Cover-Sizes | string |
| Range | string |
{- "events": [
- {
- "id": "string",
- "title": "Album of the week",
- "created": "string",
- "source_type": "user",
- "source": {
- "id": "string",
- "firstname": "string",
- "lastname": "string",
- "username": "string",
- "favourite": true,
- "favouritees_count": 0,
- "favourite_users_count": 0,
- "featureset": { }
}, - "action_id": "string",
- "target_type": "user",
- "target": {
- "id": "string",
- "firstname": "string",
- "lastname": "string",
- "username": "string",
- "favourite": true,
- "favouritees_count": 0,
- "favourite_users_count": 0,
- "featureset": { }
}
}
]
}Return only favourite entities. So favourited will be equal to true in the response. Unfavourited entities will never be present in the response.
| entity_type required | string Enum: "artist" "release" "release-group" "track" "user" type of the entities |
| entity_id required | string Example: entity_id=1,2,3 comma-separated list of entity IDs to test, limited to 1000 items. |
{- "favourites": [
- {
- "entity_type": "artist",
- "entity_id": "string",
- "favourited": true
}
]
}The Integrations API is a collection of endpoints implementing specifications from Partners.
This is used to propagate business events from the partner to Beat.
Each partner endpoint has a subresource under /v2/integrations/
Handle the request from Stripe
You can check documentation here.
Handle the request from Reepay
You can check reepay documentation here
Complete password reset process by providing security code received by sms or email.
Guests (unauthorized users) can do this call.
msisdn or email should be present (not both)
Backend logic:
code equals to stored code from preceding request POST /v2/passwords/requests. | msisdn | string msisdn or email should be present (not both) |
string msisdn or email should be present (not both) | |
| code | string security code received by sms or email |
| password | string new password to set |
{- "msisdn": "string",
- "email": "string",
- "code": "string",
- "password": "string"
}{ }It initiates password reset process by sending code by sms or email.
Guests (unauthorized users) can do this call.
msisdn or email should be present (not both)
Backend logic:
return=true passed, then it returns code back rather than send it to the customer| msisdn | string msisdn or email should be present (not both) |
string msisdn or email should be present (not both) | |
| return | boolean default to false, pass true to get |
{- "msisdn": "string",
- "email": "string",
- "return": true
}{- "code": "email-token or sms-code"
}Access to products limited to given access_token/client_id, for instance:
{- "product": {
- "id": "string",
- "name": "string",
- "description": "string",
- "surface_id": "string",
- "type": "string",
- "recurring_price": 0,
- "recurring_interval": 0,
- "recurring_interval_unit": "DAY",
- "trial_price": 0,
- "trial_interval": 0,
- "trial_interval_unit": "DAY",
- "lock_interval": 0,
- "lock_interval_unit": "DAY",
- "items": [
- {
- "grants": "subscription",
- "type": "recurring",
- "unit": "string",
- "amount": 0
}
]
}
}| Range | string |
{- "products": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "surface_id": "string",
- "type": "string",
- "recurring_price": 0,
- "recurring_interval": 0,
- "recurring_interval_unit": "DAY",
- "trial_price": 0,
- "trial_interval": 0,
- "trial_interval_unit": "DAY",
- "lock_interval": 0,
- "lock_interval_unit": "DAY",
- "items": [
- {
- "grants": "subscription",
- "type": "recurring",
- "unit": "string",
- "amount": 0
}
]
}
]
}This can be used to find the latest played entity
| entity_type | string Enum: "track" "release" |
| entity_id | string Example: entity_id=1,2,3 Comma separated list of ids |
| Range | string |
{- "progresses": [
- {
- "id": "string",
- "entity_type": "track",
- "entity_id": "string",
- "changed": "string",
- "position_type": "audio",
- "stop_position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}
]
}Tolerates conflict existing progress: if there is existing progress record on the same entity, then it updates the existing record with the new stop_position and timestamp (i.e. performs upsert)
| entity_type required | string Enum: "track" "release" |
| entity_id required | string |
| changed required | string <Y-m-d H:i:s> time of most recent stop_position update - in UTC timezone |
| position_type | string Enum: "ebook" "audio" defaults to audio |
| stop_position | integer required if position_type=audio, seconds since beginning of entity |
| reader_position_selector | string required if position_type=ebook, EPUB CFI (Canonical Fragment Identifier) |
| reader_position_ratio | number <double> [ 0 .. 1 ] required if position_type=ebook, position as a fraction of pages read (range: 0-1) |
{- "entity_type": "track",
- "entity_id": "string",
- "changed": "string",
- "position_type": "ebook",
- "stop_position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}{- "progress": {
- "id": "string",
- "entity_type": "track",
- "entity_id": "string",
- "changed": "string",
- "position_type": "audio",
- "stop_position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}
}{- "progress": {
- "id": "string",
- "entity_type": "track",
- "entity_id": "string",
- "changed": "string",
- "position_type": "audio",
- "stop_position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}
}| progress_id required | string |
| changed required | string <Y-m-d H:i:s> time of most recent stop_position update - in UTC timezone |
| position_type | string Enum: "ebook" "audio" defaults to audio |
| stop_position | integer required if position_type=audio, seconds since beginning of entity |
| reader_position_selector | string required if position_type=ebook, EPUB CFI (Canonical Fragment Identifier) |
| reader_position_ratio | number <double> [ 0 .. 1 ] required if position_type=ebook, position as a fraction of pages read (range: 0-1) |
{- "changed": "string",
- "position_type": "ebook",
- "stop_position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}{- "progress": {
- "id": "string",
- "entity_type": "track",
- "entity_id": "string",
- "changed": "string",
- "position_type": "audio",
- "stop_position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}
}{- "quotas": [
- {
- "quota_start": "string",
- "quota_end": "string",
- "available_seconds": 0,
- "used_seconds": 0,
- "quota_seconds": 0,
- "unlimited_access": true,
- "streaming_access": true,
- "download": true,
- "source": "string"
}
]
}| entity_type required | string Example: entity_type=release "release" only |
| entity_id required | string |
| Range | string |
{- "ratings": [
- {
- "id": "string",
- "value": 5,
- "note": "string",
- "entity_type": "release",
- "entity_id": "release_id, track_id or artist_id"
}
]
}| X-Change-Timestamp | string |
| entity_type required | string Enum: "track" "release" "artist" |
| entity_id required | string corresponds to |
| value required | integer |
| note | string |
{- "entity_type": "track",
- "entity_id": "track_id, release_id, or artist_id",
- "value": 0,
- "note": "string"
}{- "rating": {
- "id": "string",
- "value": 5,
- "note": "string",
- "entity_type": "release",
- "entity_id": "release_id, track_id or artist_id"
}
}| rating_id required | string |
| X-Change-Timestamp | string |
All request parameters are optional, but at least one should be present
| value | integer |
| note | string |
{- "value": 0,
- "note": "string"
}{- "rating": {
- "id": "string",
- "value": 5,
- "note": "string",
- "entity_type": "release",
- "entity_id": "release_id, track_id or artist_id"
}
}Add X-Include: release-prices in order to include prices to the response
Examples:
/v2/releases/100
/v2/releases/9788242180711?ns=isbn
| release_id required | string release id if no |
| ns | string namespace of identifiers, supported values: ''isbn'' |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
{- "release": {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "favourites_count": 0,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0,
- "name": "string",
- "description": "string",
- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}, - "tracks": [
- {
- "id": "string",
- "title": "string",
- "subtitle": "string",
- "duration": 0,
- "duration_iso": "PT23M15.3S",
- "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "favourite": true,
- "url": "string",
- "release": {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}, - "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "streams": [
- {
- "id": "string",
- "type": "string"
}
]
}
], - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
]
}
}Assume the operation is always success.
Add any custom HTTP headers (like for the GET request, ex: X-Release-Cover-Sizes, X-Artist-Image-Sizes and others) in order to receive necessary data in the response.
Server logic:
IMPORTANT PATCH request is responsible for merging object received from client and object stored on server. Server resolves conflicts if there is any. The response from PATCH will contain the merged version of the object in that case. See User Changes API for the details.
| release_id required | string |
| X-Base_Change | integer base change id, defaults to 0 server side |
| X-Change-Timestamp | string time of change in UTC, defaults to current time on the backend |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
parameters are optional, but at least one of them should be present
| favourite | boolean |
{- "favourite": true
}{- "release": {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "favourites_count": 0,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0,
- "name": "string",
- "description": "string",
- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}, - "tracks": [
- {
- "id": "string",
- "title": "string",
- "subtitle": "string",
- "duration": 0,
- "duration_iso": "PT23M15.3S",
- "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "favourite": true,
- "url": "string",
- "release": {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}, - "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "streams": [
- {
- "id": "string",
- "type": "string"
}
]
}
], - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
]
}
}List available variants of a given book. If book is available in the form of ebook and audio book then both included into response.
Response can be paginated based on Range headers.
| id required | string |
{- "releases": [
- {
- "id": "string",
- "type": "album"
}
]
}See Bookmarks API for details.
Get paginated list of bookmarks for specific release.
| release_id required | string |
| Range | string |
{- "bookmarks": [
- {
- "id": "string",
- "entity_type": "track",
- "entity_id": "string",
- "added": "string",
- "note": "string",
- "position_type": "audio",
- "position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}
]
}Response can be paginated based on Range headers.
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| Range | string |
| X-Include | string |
{- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}Authorization: requires editorial admin token
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
Array of objects (id_object) |
{- "releases": [
- {
- "id": "string"
}
]
}{- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}Get a specific release group by ID
| group_id required | string Enum: "purchased" "borrowed" "finished" "played" "wishlist" "*" ID may have one of predefined values.
|
| X-Release-Cover-Sizes | string |
| X-Release-Group-Image-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
{- "group": {
- "id": "string",
- "name": "string",
- "description": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "permission": "READ",
- "favourite": true,
- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}
}Access token requires special permission.
All request parameters are optional, but at least one should be present
| group_id required | string Enum: "wishlist" "*" only |
| X-Release-Group-Image-Sizes | string |
| X-Release-Cover-Sizes | integer header specifies sizes for Release cover basic objects. See Basic response object section for details. |
| X-Artist-Image-Sizes | string Header specifies sizes for Artist image basic object. |
| X-Base-Change | integer |
| X-Change-Timestamp | string |
| name | string |
| visible | boolean |
Array of objects (group_entry-2) can be empty |
{- "name": "string",
- "visible": true,
- "releases": [
- {
- "id": "string"
}
]
}{- "group": {
- "id": "string",
- "name": "string",
- "description": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "permission": "READ",
- "favourite": true,
- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}
}| group_id required | string Enum: "purchased" "borrowed" "finished" "played" "wishlist" |
| release_ids | Array of strings comma-separated list of release IDs, limited to 1000 items. Supported with |
| response_type | string If equal to ''id'' returns only releases ids |
| X-Release-Cover-Sizes | integer header specifies sizes for Release cover basic objects. See Basic response object section for details. |
| X-Actor-Image-Sizes | string Header specifies sizes for Actor image objects. |
| X-Include | string |
| Range | string |
{- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}Get a list of all currently visible release groups.
If optional HTTP header X-Include: group-releases is present in the request, the response will include Release base objects instead of just objects with release ids.
| X-Release-Group-Image-Sizes | string |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
| Range | string |
{- "groups": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "visible": true,
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "permission": "READ",
- "favourite": true,
- "releases": [
- {
- "id": "string"
}
]
}
]
}Requires user token.
| X-Change-Timestamp | string |
| name required | string |
| description | string |
Array of objects |
{- "name": "string",
- "description": "string",
- "releases": [
- {
- "id": "string"
}
]
}{- "group": {
- "id": "string",
- "name": "string",
- "description": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "permission": "READ",
- "favourite": true,
- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}
}Access token requires special permission.
| X-Release-Group-Image-Sizes | string |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
Array of objects (Release Group Patch Request) |
{- "groups": [
- {
- "id": "string"
}
]
}{- "groups": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "visible": true,
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "permission": "READ",
- "favourite": true,
- "releases": [
- {
- "id": "string"
}
]
}
]
}| X-Release-Group-Image-Sizes | string |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
| Range | string |
{- "groups": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "visible": true,
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "permission": "READ",
- "favourite": true,
- "releases": [
- {
- "id": "string"
}
]
}
]
}| X-Release-Group-Image-Sizes | string |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
Array of objects |
{- "groups": [
- {
- "id": "string"
}
]
}{- "groups": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "visible": true,
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "permission": "READ",
- "favourite": true,
- "releases": [
- {
- "id": "string"
}
]
}
]
}| release_id required | string |
| Range | string |
{- "ratings": [
- {
- "id": "string",
- "value": 5,
- "note": "string",
- "entity_type": "release",
- "entity_id": "release_id, track_id or artist_id"
}
]
}Returns personalised recommendations based on historical data (play logs)
| X-Release-Cover-Sizes | string |
| X-Artist-Image-Sizes | string |
| X-Include | string |
| Range | string |
{- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}Get paginated list of bookmarks for specific release.
| release_id required | string |
| Range | string |
{- "bookmarks": [
- {
- "id": "string",
- "entity_type": "track",
- "entity_id": "string",
- "added": "string",
- "note": "string",
- "position_type": "audio",
- "position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}
]
}Get paginated list of progresses for specific release.
| release_id required | string |
| Range | string |
{- "progresses": [
- {
- "id": "string",
- "entity_type": "track",
- "entity_id": "string",
- "changed": "string",
- "position_type": "audio",
- "stop_position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}
]
}| upc_code required | string Example: 0724382304258 |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
{- "release": {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
}Clients MUST collect each and every player/reader event and report them to POST /v2/reports. Clients must keep track of events in the offline mode and report them as soon as a connection establishes.
API
POST /v2/player/reports - still functional but deprecated in favour of more generic POST /v2/reportsPOST /v2/reports - accepts all types of reports listed belowReports
played-offlineMotitechplay.started - track-based report when player starts playing a new track in music servicesplay.ended - track-based report, mandatory for clients using /v2/streams/online and /v2/streams/offline endpoints to fetch a stream urlplay.progress - track-based playback progress tracking in audiobook services.play.error - track-based report when playing the current track failsNew event format
Important! These events require action to be set instead of event.
player.progress - track-/release-based report for tracking playback in audiobook servicesreader.progress - track-/release-based report for tracking reading in ebook services.reader.consumed - release-based report for when a release has been consumedrelease.finished - release-based report for a release being finishedVersioning
context field with data specific to a stream which clients get from the backend. Also we don't expect a shop field anymore.Example
Consider the following case:
The user plays a track from the beginning, 45 seconds later they seek to the 100th second, listens for 3 seconds, then presses "skip 30 seconds" twice, then listens for 40 more seconds, presses "pause", then "resume", listens for 15 more seconds and plays a different track.
The following reports should be sent:
play.started (start_position:0)
play.progress (start_position:0, stop_position:30)
play.progress (start_position:30, stop_position:45)
play.progress (start_position:163, stop_position:193)
play.progress (start_position:193, stop_position:203)
play.progress (start_position:203, stop_position:218)
play.ended (duration:103)\n\nplay.started (start_position:0)
Notice there is no report play.progress (start_position:100, stop_position:103) since user seeks to the 100th second, therefore we do not report progress until the track was played for 30 more seconds.
Here is another example illustrating the difference in report playback progress after seek vs after start/resume:
start 150 -> at 160 seek to 200 -> play for 20 more seconds -> seek to 250 -> play next track at 260:
play.started (start_position:150)
play.progress (start_position:150, stop_position:160)
play.progress (start_position:250, stop_position:260)
play.ended (duration:40)
vs.
start at 150 -> at 160 seek to 200 -> play for 35 more seconds -> seek to 250 -> play next track at 260:
play.started (start_position:150)
play.progress (start_position:150, stop_position:160)
play.progress (start_position:200, stop_position:230)
play.progress (start_position:230, stop_position:235)
play.progress (start_position:250, stop_position:260)
play.ended (duration:55)
| action required | string Value: "player.progress" |
| version required | integer Value: 3 |
| time required | integer event timestamp - seconds, unix epoch time |
| user_id required | string |
| device_id | string unique device-id set by the client |
| offline required | boolean |
| speed | number <float> 0.8 means |
| entity_type required | string Enum: "track" "release" |
| entity_id required | string corresponds to |
| start_position required | integer seconds since beginning of entity |
| stop_position required | integer seconds since beginning of entity |
| total_len | integer ex: length of release/track |
| sent_time required | integer timestamp when the event was sent from originator, unix epoch time |
| preview | boolean set if particular service requires reporting for previews |
| context | object arbitrary mapping, filled with an equivalent mapping provided by backend to clients along with the consumed content |
{- "play_ended": {
- "$ref": "./example_reports.yaml#/play.ended"
}, - "play_error": {
- "$ref": "./example_reports.yaml#/play.error"
}, - "play_progress": {
- "$ref": "./example_reports.yaml#/play.progress"
}, - "play_started": {
- "$ref": "./example_reports.yaml#/play.started"
}, - "played_offline": {
- "$ref": "./example_reports.yaml#/played-offline"
}, - "player_progress_v1": {
- "$ref": "./example_reports.yaml#/player.progress_v1"
}, - "player_progress_v3": {
- "$ref": "./example_reports.yaml#/player.progress_v3"
}, - "reader_consumed_v1": {
- "$ref": "./example_reports.yaml#/reader.consumed_v1"
}, - "reader_consumed_v3": {
- "$ref": "./example_reports.yaml#/reader.consumed_v3"
}, - "reader_progress_v1": {
- "$ref": "./example_reports.yaml#/reader.progress_v1"
}, - "reader_progress_v3": {
- "$ref": "./example_reports.yaml#/reader.progress_v3"
}, - "release_finished": {
- "$ref": "./example_reports.yaml#/release.finished"
}
}{ }| query | string |
| X-Series-Image-Sizes | string |
| Range | string |
{- "series": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
]
}| series_id required | string |
| X-Series-Image-Sizes | string |
{- "series": {
- "id": "string",
- "name": "string",
- "description": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
}| series_id required | string |
| X-Series-Image-Sizes | string |
| name | string |
| description | string |
{- "name": "string",
- "description": "string"
}{- "series": {
- "id": "string",
- "name": "string",
- "description": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
}This API contains endpoints for executing business logic in response to incoming SMS messages. Its intended user is the SMS service.
All incoming messages which require any business logic processing will be forwarded by the SMS service to this endpoint.
| id required | integer |
| sender required | string full MSISDN of the sender |
| text required | string text of message |
{- "id": 0,
- "sender": "string",
- "text": "string"
}{- "message": "string"
}The state parameter is the result of the delivery as confirmed by the operator. Valid values are:
Many of these are self-explanatory or explained; the others can be found in the SMS service API docs [to be published].
Note that DELIVERED is the only state indicating successful delivery. If the message had a price, only DELIVERED indicates that this price was successfully charged.
| id required | integer ID of message referenced by this report |
| receiver required | string full MSISDN of the message's receiver |
| price required | integer the price that was attempted to be charged |
| state required | string Enum: "DELIVERED" "INSUFFICIENT_FUNDS" "UNDELIVERABLE" "FAILED" "BARRED_PERMANENTLY" "BARRED_TEMPORARILY" "BARRED_PREMIUM" "BARRED_AGE_LIMIT" "INVALID_NETWORK" one of the state constants |
{- "id": 0,
- "receiver": "string",
- "price": 0,
- "state": "DELIVERED"
}{- "message": "string"
} Specify optional header X-Stream-Formats: */high, X-Stream-Formats: */normal, X-Stream-Formats: */low in order to adjust audio stream quality. Header value should go from streams object of TrackExtended object - see GET v2/tracks/:track_id for details.
Getting stream url normally requires user access token and user has be subscribed. However there is a way to get stream url based on different criteria. This is service specific.
Specify optional header X-Stream-Context: <entity_type>/<entity_id> in order to fetch full stream.
Get a link to a short preview stream. These streams typically have a length between 30 and 60 seconds.
examples:
| id required | string track id if |
| ns | string namespace of ids, value |
{- "stream": {
- "id": "string",
- "url": "string",
- "duration": 0,
- "type": "string",
- "source": {
- "type": "string",
- "offset": 0
}, - "context": {
- "shop": "string"
}
}
}Get the link to the full stream for online playing.
X-Stream-Formats, X-Stream-Context headers - see Streams API. IMPORTANT: Client MUST keep track of playback of streams for URLs fetched from this endpoint by sending play reports to the Player Reports API POST v2/player/reports.
For a music service, one should use play.ended events while for audio book service, one should use play.progress events.
Independent of type of service, be sure to set offline=true for offline playback and offline=false for online playback.
| track_id required | string |
| X-Stream-Formats | string |
| X-Stream-Context | string |
{- "stream": {
- "id": "string",
- "url": "string",
- "duration": 0,
- "type": "string",
- "source": {
- "type": "string",
- "offset": 0
}, - "context": {
- "shop": "string"
}
}
}Get the link to the full stream for offline playing.
X-Stream-Formats, X-Stream-Context headers - see Streams API. IMPORTANT: Client MUST keep track of playback of streams for URLs fetched from this endpoint by sending play reports to the Player Reports API POST v2/player/reports.
For a music service, one should use play.ended events while for audio book service, one should use play.progress events.
Independent of type of service, be sure to set offline=true for offline playback and offline=false for online playback.
| track_id required | string |
{- "stream": {
- "id": "string",
- "url": "string",
- "duration": 0,
- "type": "string",
- "source": {
- "type": "string",
- "offset": 0
}, - "context": {
- "shop": "string"
}
}
}Get URL to the stream or preview
| track_id required | string |
{- "stream": {
- "id": "string",
- "url": "string",
- "duration": 0,
- "type": "string",
- "source": {
- "type": "string",
- "offset": 0
}, - "context": {
- "shop": "string"
}
}
}For a given release return all its streams
| release_id required | string |
{- "track": {
- "id": 0
}, - "streams": {
- "id": "string",
- "url": "string",
- "duration": 0,
- "type": "string",
- "source": {
- "type": "string",
- "offset": 0
}, - "context": {
- "shop": "string"
}
}
}Response can be paginated based on Range headers.
| query required | string |
| Range | string tracks=20-39 (inclusive) |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
{- "tracks": [
- {
- "id": "string",
- "title": "string",
- "subtitle": "string",
- "duration": 0,
- "duration_iso": "PT23M15.3S",
- "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "favourite": true,
- "url": "string",
- "release": {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}, - "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "streams": [
- {
- "id": "string",
- "type": "string"
}
]
}
]
}track-prices to X-Include header in order to include prices to the response. track-streams to X-Include header in order to include streams to the response.| track_id required | string |
| X-Actor-Image-Sizes | string |
| X-Release-Cover-Sizes | string |
| X-Include | string |
{- "track": {
- "id": "string",
- "title": "string",
- "subtitle": "string",
- "duration": 0,
- "duration_iso": "PT23M15.3S",
- "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "favourite": true,
- "url": "string",
- "release": {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}, - "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "streams": [
- {
- "id": "string",
- "type": "string"
}
]
}
}Assume the operation is always success.
Add any custom HTTP headers (like for the GET request, ex: X-Release-Cover-Sizes, X-Artist-Image-Sizes and others) in order to receive necessary data in the response.
server logic:
IMPORTANT PATCH request is responsible for merging object received from client and object stored on server. Server resolves conflicts if there is any. The response from PATCH will contain the merged version of the object in that case. See User Changes API for the details.
| track_id required | string |
| X-Base-Change | integer base change id, defaults to 0 server side |
| X-Change-Timestamp | string time of change in UTC, defaults to current time on the backend |
| X-Actor-Image-Sizes | string |
| X-Release-Cover-Sizes | string |
| X-Include | string |
all the request parameters are optional, but at least one should be present
| favourite | boolean |
{- "favourite": true
}{- "track": {
- "id": "string",
- "title": "string",
- "subtitle": "string",
- "duration": 0,
- "duration_iso": "PT23M15.3S",
- "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "favourite": true,
- "url": "string",
- "release": {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}, - "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "streams": [
- {
- "id": "string",
- "type": "string"
}
]
}
}Get paginated list of bookmarks for specific track
| track_id required | string |
| Range | string |
{- "bookmarks": [
- {
- "id": "string",
- "entity_type": "track",
- "entity_id": "string",
- "added": "string",
- "note": "string",
- "position_type": "audio",
- "position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}
]
}| track_id required | string |
{- "progress": {
- "id": "string",
- "entity_type": "track",
- "entity_id": "string",
- "changed": "string",
- "position_type": "audio",
- "stop_position": 0,
- "reader_position_selector": "epubcfi(/6/2!/0)",
- "reader_position_ratio": 1
}
}NOTE: :user_id is actual user id if the access_token had been generated with end-user-related grant_type: grant_type=password.
Lookup, search, list users:
CRUD operations with single user:
List user friends:
User Credentials API:
User Events API:
This is a way to sync personal changes made by user (typically in offline mode) in the apps.
SECURITY NOTE. There is no way to sync personal changes in visitor mode or having Access Token from other user, since it obviously breaks isolation of users from each other.
LOGOUT IN OFFLINE MODE. When user is going to log out being in offline mode and there are unsynced local changes, the app CAN suggest user to go online and sync pending changes first before logging out otherwise unsynced changes can be lost.
HEAD /v2/users/:user_id/changes - get personal latest change_id in X-Change response header.POST /v2/batch within a set of POST, PATCH, DELETE subrequests - push local changes and get back merged versions to update a local copy if there is any conflictsGET /v2/users/:user_id/changes?base_change_id=:base_change_id - pull new changes since the last syncchange_id from serverTrigger it only if local base_change_id is 0 (no previous syncs).
>>>
HEAD /v2/users/:user_id/changes
<<<
X-Change: <latest_change_id>
Compose all local changes into one or a few BATCH requests. Set base_change_id to tell server what latest version of local data the change is based on: mark each subrequest with new base_change_id and change_timestamp fields.
X-Change-Timestamp must in UTC if set.
Request:
POST /v2/batch
{
// oldest changes first
"requests": [
{ "method": "POST", "url": "/v2/releases/groups", "body": { ... }, "headers": {"X-Base-Change": 123, "X-Change-Timestamp": ""}},
{ "method": "POST", "url": "/v2/releases/groups", "body": { ... }, "headers": {"X-Base-Change": 123, "X-Change-Timestamp": ""} },
{ "method": "PATCH", "url": "/v2/tracks/:id", "body": { ... }, "headers": {"X-Base-Change": 123, "X-Change-Timestamp": ""} },
{ "method": "PATCH", "url": "/v2/releases/:id", "body": { ... }, "headers": {"X-Base-Change": 123, "X-Change-Timestamp": ""} },
{ "method": "DELETE", "url": "/v2/releases/groups/:id", "body": { ...}, "headers": {"X-Base-Change": 123, "X-Change-Timestamp": ""} },
]
}
Server logic:
IMPORTANT PATCH request is responsible for merging object received from client and object stored on server. Server resolves conflicts if there is any. The response from PATCH will contain the merged version of the object in that case.
example of user_changes data:
intID, intUser_ID, intEntityType, intEntityID, intActionType, dteAdded, dteChanged
1, 5667, release-group, 132, PATCH, CURRENT_TIMESTAMP
2, 5667, release-group, 132, DELETE, CURRENT_TIMESTAMP
3, 123, track, 8, PATCH, CURRENT_TIMESTAMP
4, 5667, artist, 1, PATCH, CURRENT_TIMESTAMP
Response:
{
// count and order of responses corresponds to the request
"responses": [
{ "status": 201, "body": { "id": "123", <merge result> }, "headers": {"X-Change": 1} },
{ "status": 201, "body": { "id": "124", <merge result> }, "headers": {"X-Change": 2} },
{ "status": 200, "body": { "id": "124", <merge result> }, "headers": {"X-Change": 81} },
{ "status": 200, "body": { "id": "124", <merge result> }, "headers": {"X-Change": 82} },
{ "status": 404, "body": { "error_description": "Not found" } },
]
}
Client can ignore the response from BATCH.
Request:
GET /v2/users/:user_id/changes?base_change_id=:base_change_id
Range: changes=0-99 // (optional) fetch first 100 changes
Response:
206 Partial Content
Content-Range: changes 0-99/101 // first page, more available
{
"changes": [
{ "id": 1, "method": "POST", "body": { "group": {Release group extended object} } },
{ "id": 2, "method": "POST", "body": { "group": {Release group extended object} } },
{ "id": 81, "method": "PATCH", "body": { "track": {Track extended object} } },
{ "id": 82, "method": "DELETE", "body": { "group": { "id": "123" }} }, // only "id" is provided if object is deleted
{ < Change object > },
]
}
Client should act in the same way in case of PATCH and POST - update local object.
Change object
{
"id": 1, // change id
"method": "POST|PATCH|DELETE",
"body": {
"release": { // one of track|release|artist
"id": "123",
// ...
}
}
}
When the response is received, client should set local base_change_id to the max change_id from the response (that means client has been upgraded up to the change_id version).
Methods to manipulate the running subscriptions.
GET /v2/users/:user_id/subscriptions - list of all running subscriptionsPATCH /v2/users/:user_id/subscriptions/:sub_id + {state=6|3} - cancel/resume subscriptionDELETE /v2/users/:user_id/subscriptions/:sub_id - deactivate subscriptionSubscription states (possible state values):
1 - TRIALING live: valid trial subscription. This type of subscription may transition to active once payment is received when the trial has ended.3 - ACTIVE live: a normal, active subscription. It is not in a trial, and is paid and up to date.5 - RENEW_FAILURE problem: indicates that the most recent payment has failed, and payment is past due for this subscription. This subscription is in the dunning process.6 - STOPPED live until expiry date / end of life then: a subscription stopped by user.7 - DEACTIVATED end of life: a subscription deactivated during migrate process8 - UNPAID end of life: a subscription is marked unpaid if the retry period expires and dunning has a Final Action of “mark the subscription unpaid”9 - INCOMPLETE live: payment request has been issued, but confirmation has not yet been receivedNOTE:
email or msisdn set, or account_users=true, an extended user object will be returned.external_provider_id and external_user_id set, a base user object wil be returned.string search by email (only accessible to user admins) | |
| msisdn | string search by msisdn (only accessible to user admins) |
| account_users | boolean list account users (profiles) |
| external_user_id | string Search by external id. Should be specified with |
| external_provider_id | string Search by external id. Should be specified with |
| Range | string |
{- "users": [
- {
- "id": "string",
- "firstname": "string",
- "lastname": "string",
- "username": "string",
- "favourite": true,
- "favouritees_count": 0,
- "favourite_users_count": 0,
- "featureset": { }
}
]
}Covers these use cases:
A random password will be generated for the account.
| msisdn | string |
| firstname | string |
| lastname | string |
| username | string |
string | |
| password | string Password should not appear if msisdn present |
| newsletter | boolean Default: false |
| intent | string Enum: "webshop" "subscription" the way to distinguish purposes of user creation within the single client, one of ''webshop''|''subscription''. |
| profile_type | string Enum: "standard" "child" |
| email_token | string Email token validation expects to have email set for user |
| avatar_id | string |
| region | string The region that the user belongs to |
{- "msisdn": "004712345678",
- "firstname": "string",
- "lastname": "string",
- "username": "string",
- "email": "email@beat.no",
- "password": "string",
- "newsletter": false,
- "intent": "webshop",
- "profile_type": "standard",
- "email_token": "string",
- "avatar_id": "string",
- "region": "NO"
}{- "user": {
- "id": "string",
- "firstname": "string",
- "lastname": "string",
- "username": "string",
- "favourite": true,
- "favouritees_count": 0,
- "favourite_users_count": 0,
- "featureset": { }
}
}Server logic:
IMPORTANT PATCH request is responsible for merging object received from client and object stored on server. Server resolves conflicts if there is any. The response from PATCH will contain the merged version of the object in that case. See User Changes API for the details.
| user_id required | string |
| X-Base_Change | integer base change id, defaults to 0 server side |
| X-Change-Timestamp | string time of change in UTC, defaults to current time on the backend |
| X-User-Image-Sizes | string |
all parameters are optional, but at least one of them should be present
| firstname | string |
| lastname | string |
string | |
| region | string |
| password | string |
| privacy_profile_private | boolean |
| favourite | boolean follow/unfollow user |
| newsletter | boolean subscribe/unsubscribe to email newsletters |
| payment_type | integer see list of supported payment types on User API (user object) |
| username | string |
| profile_type | string Enum: "standard" "child" |
{- "firstname": "string",
- "lastname": "string",
- "email": "string",
- "region": "string",
- "password": "string",
- "privacy_profile_private": true,
- "favourite": true,
- "newsletter": true,
- "payment_type": 0,
- "username": "string",
- "profile_type": "standard"
}{- "user": {
- "id": "string",
- "firstname": "string",
- "lastname": "string",
- "username": "string",
- "favourite": true,
- "favouritees_count": 0,
- "favourite_users_count": 0,
- "featureset": { }
}
}Get user account info except of any credentials (i.e. password)
| user_id required | string |
| X-User-Image-Sizes | string |
{- "user": {
- "id": "string",
- "firstname": "string",
- "lastname": "string",
- "username": "string",
- "favourite": true,
- "favouritees_count": 0,
- "favourite_users_count": 0,
- "featureset": { }
}
}Access level: Requires user token.
When credit card successfully attached, it changes user's default payment type to Stripe. See payment_type of User entity in User API.
| user_id required | string |
| token required | string credit card token from by Stripe JS SDK |
{- "token": "string"
}{ }GET /v2/users/:user_id/changes - fetch all personal changes GET /v2/users/:user_id/changes?base_change_id=:base_change_id :base_change_id (optional) is a client's local base_change_id (change_id from the previous syncronization incremented by 1)| user_id required | string |
| base_change_id | string |
| Range | string changes=0-99 fetch first 100 changes |
| X-Release-Cover-Sizes | string |
| X-Artist-Image-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-User-Image-Sizes | string |
| X-Release-Group-Image-Sizes | string |
| X-Include | string |
{- "changes": [
- {
- "status": 201,
- "body": {
- "change_id": 1,
- "id": "123"
}
}, - {
- "status": 201,
- "body": {
- "change_id": 2,
- "id": "124"
}
}, - {
- "status": 200,
- "body": {
- "change_id": 81
}
}, - {
- "status": 200,
- "body": {
- "change_id": 82
}
}
]
}This has to be used to get latest change_id of personal changes when user just logged in.
Since API returns latest state of personal collections, client need to know latest change_id. Having latest change_id client is able to skip fetching all the time history of user changes just to get latest change_id. So that significantly speeds initial synchronisation up on log in to the old account.
When the response is received, client should set local base_change_id to the change_id from the response (that means client has been upgraded up to the change_id version).
| user_id required | string |
Supports regular pagination.
| user_id required | string |
| type | string type of coupons to list . supports ''giftcard'' only |
| X-Coupon-Offer-Image-Sizes | string |
| Range | string |
{- "coupons": [
- {
- "id": "string",
- "code": "string",
- "interval": 6,
- "interval_unit": "MONTH",
- "valid": true,
- "used": true,
- "created": "string",
- "product_id": "string",
- "payment_state": 0,
- "payment_updated": "string",
- "balance_unit": "string",
- "balance_amount": 0,
- "renewable": true,
- "offer_id": "string",
- "name": "3 month membership",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
]
}Allows to redeem coupon to any target account.
user_id for target account by GET /v2/user?msisdn=:msisdn.| user_id required | string |
| coupon | string |
{- "coupon": "string"
}{ }Bind credential to the account or accept it for verification.
Bind new type of credentials to the user account. If credential requires verification, then it initiates verification process by sending verification email or sms.
Access level: Requires User Token.
| user_id required | string |
| type required | integer Enum: 5 6 7 8 9 10 Credential type. One of:
|
| credential required | string |
{- "type": 5,
- "credential": "string"
}{ }Verify the e-mail address used in account creation. Verification is important since this is the only channel where the user can receive updates regarding billing status and other account information.
| type | integer Enum: 6 8 This API can be used with two credential types:
There is no difference except in the bokbasen case, we search the bokbasen account upstream. |
| credential | string A string that identifies user. For now, only the two types of email is supported. |
{- "type": 8,
- "credential": "string"
}{ }Access level: requires visitor token.
| user_id required | string |
| token | string |
| type | integer Enum: 5 6 7 8 9 10 Credential type. One of:
|
{- "token": "string",
- "type": 5
}{ }All events are generated by the backend (by PATCH v2/users/:id + favourite and PATCH v2/artists/:id + favourite at the moment).
| user_id required | string |
| Range | string |
| X-Artist-Image-Sizes | string |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
{- "events": [
- {
- "id": "string",
- "title": "Album of the week",
- "created": "string",
- "source_type": "user",
- "source": {
- "id": "string",
- "firstname": "string",
- "lastname": "string",
- "username": "string",
- "favourite": true,
- "favouritees_count": 0,
- "favourite_users_count": 0,
- "featureset": { }
}, - "action_id": "string",
- "target_type": "user",
- "target": {
- "id": "string",
- "firstname": "string",
- "lastname": "string",
- "username": "string",
- "favourite": true,
- "favouritees_count": 0,
- "favourite_users_count": 0,
- "featureset": { }
}
}
]
}| user_id required | string |
| Range | string |
{- "users": [
- {
- "id": "string",
- "firstname": "string",
- "lastname": "string",
- "username": "string",
- "favourite": true,
- "favouritees_count": 0,
- "favourite_users_count": 0,
- "featureset": { }
}
]
}| user_id required | string |
| X-Artist-Image-Sizes | string |
| Range | string |
{- "artists": [
- {
- "id": "string",
- "name": "string",
- "url": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "favourite": true
}
]
}| user_id required | string |
| types | string comma-separated list of release types, it may include shortened (see Release API for details) |
| Range | string |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
{- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}| user_id required | string |
| Range | string |
| X-Actor-Image-Sizes | string |
{- "tracks": [
- {
- "id": "string",
- "title": "string",
- "subtitle": "string",
- "duration": 0,
- "duration_iso": "PT23M15.3S",
- "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "favourite": true,
- "url": "string",
- "release": {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}, - "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "streams": [
- {
- "id": "string",
- "type": "string"
}
]
}
]
}| user_id required | string |
| Range | string |
{- "users": [
- {
- "id": "string",
- "firstname": "string",
- "lastname": "string",
- "username": "string",
- "favourite": true,
- "favouritees_count": 0,
- "favourite_users_count": 0,
- "featureset": { }
}
]
}Activate subscription based on given product id, i.e. upgrade/downgrade logic.
| user_id required | string |
| product_id required | string |
| renewable | boolean defaults to true, whether new subscription should renew or not |
| utm_campaign | string utm campaign name, may adjust subscription trial period if specified |
| confirmed | boolean true by default; if false, request may return 403 code alongside with the url to external confirmation/consent page |
| metadata | object <json> a json structure for associating information with the subscription |
{- "product_id": "string",
- "renewable": true,
- "utm_campaign": "string",
- "confirmed": true,
- "metadata": { }
}{ }It generates new password for the user, saves it and sends it by sms.
SECURITY NOTE: Only limited number of clients are allowed to do this call. Certain client should be allowed to reset password only for limited number of users (likely the users created by the same client only).
Backend logic:
| user_id required | string |
{ }DEPRECATED: Use v2/users/:user_id/favourites/releases instead.
Usage:
iOS App build where the endpoint in use: <...> Android App build where the endpoint in use: v2.3.5| user_id required | string |
| Range | string |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
{- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}Get list of all running subscriptions.
| user_id required | string |
| state | string If specified fetch paginated and filtered by state subscriptions. Specify state=all to fetch all subscriptions. |
| Range | string |
{- "subscriptions": [
- {
- "id": "string",
- "product_id": "string",
- "surface_id": "string",
- "biller_id": "string",
- "start_date": "2019-08-24T14:15:22Z",
- "expiry_date": "2019-08-24T14:15:22Z",
- "next_billing_date": "string",
- "state": 0,
- "metadata": { },
- "offline_media_expiry_date": "2019-08-24",
- "partner": {
- "id": "string",
- "title": "string"
}, - "children": [ ]
}
]
}Stop/resume subscription
| user_id required | string |
| subscription_id required | string |
| state required | integer use next values:
all other values are not allowed |
| comment | string feedback when user stops the subscription |
{- "state": 0,
- "comment": "string"
}{- "subscription": {
- "id": "string",
- "product_id": "string",
- "surface_id": "string",
- "biller_id": "string",
- "start_date": "2019-08-24",
- "expiry_date": "2019-08-24",
- "next_billing_date": "string",
- "state": 0,
- "metadata": { },
- "offline_media_expiry_date": "2019-08-24"
}
}A user can have balances in multiple currencies. This lists the user's current balances by currency.
For most services, only a single currency will be returned. There are some special currency codes:
XCR means "credits".XCS means "seconds".Not receiving a balance in a currency means the same thing as receiving a zero balance in a currency.
| user_id | string |
| Range | string |
{- "balances": [
- {
- "amount": 0,
- "unit": "string"
}
]
}Get user specific release groups (bookshelves).
If optional HTTP header X-Include: group-releases is present in the request, the response will include Release base objects instead of just objects with release ids.
| user_id required | string |
| Range | string |
| X-Release-Group-Image-Sizes | string |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
{- "groups": [
- {
- "id": "string",
- "name": "string",
- "description": "string",
- "visible": true,
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "permission": "READ",
- "favourite": true,
- "releases": [
- {
- "id": "string"
}
]
}
]
}| user_id required | string |
| synthetic required | string Enum: "purchased" "borrowed" "finished" "played" "wishlist" |
| X-Release-Group-Image-Sizes | string |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
{- "group": {
- "id": "string",
- "name": "string",
- "description": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "permission": "READ",
- "favourite": true,
- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}
}msisdn or user_id has to be registered in advance. Backend logic:
return=true passed, then it returns code back instead of sending it to the customer| msisdn | string one of msisdn or user_id should present (not both) |
| user_id | string one of msisdn or user_id should present (not both) |
| return | boolean defaults to false, pass true to get |
{- "msisdn": "string",
- "user_id": "string",
- "return": true
}{- "code": "string"
}{- "layouts": [
- {
- "id": "string",
- "name": "string",
- "region": "string",
- "product_id": "string",
- "profile_type": "string",
- "sections": [
- {
- "position": 0,
- "link_type": "string",
- "link_value": "string",
- "style": "image_large",
- "banner_group_id": "string"
}
]
}
]
}| id required | string Enum: "*" "home" "podcasts" ID may have one of predefined values called |
{- "layout": {
- "id": "string",
- "name": "string",
- "region": "string",
- "product_id": "string",
- "profile_type": "string",
- "sections": [
- {
- "position": 0,
- "link_type": "string",
- "link_value": "string",
- "style": "image_large",
- "banner_group_id": "string"
}
]
}
}Change layout name. Change layout sections
| id required | integer |
| name | string |
| product_id | string or null Deprecated |
| region | string or null Deprecated |
| profile_type | string or null Deprecated |
Array of objects (layout_sections) Request sections will replace all current layout sections |
{- "name": "string",
- "product_id": "string",
- "region": "string",
- "profile_type": "string",
- "sections": [
- {
- "position": 0,
- "link_type": "string",
- "link_value": "string",
- "style": "image_large",
- "banner_group_id": "string"
}
]
}{- "layout": {
- "id": "string",
- "name": "string",
- "region": "string",
- "product_id": "string",
- "profile_type": "string",
- "sections": [
- {
- "position": 0,
- "link_type": "string",
- "link_value": "string",
- "style": "image_large",
- "banner_group_id": "string"
}
]
}
}| id required | integer Layout id |
Array of objects (layout_condition) |
{- "conditions": [
- {
- "region": "string",
- "product_id": "string",
- "profile_type": "string"
}
]
}{- "conditions": [
- {
- "region": "string",
- "product_id": "string",
- "profile_type": "string"
}
]
}When a user successfully logs in, the related subscription must be activated. Use this endpoint in order to do it. A user token from the normal OAuth2 flow must be used for this request.
| activation_id required | string |
| state | string Should be CONFIRMED |
{- "state": "CONFIRMED"
}{ }When a user clicks on a confirmation link in an email, the page with either login or password set should be shown. Use this endpoint to figure out which page and what data must be shown. A visitor token from the normal OAuth2 flow must be used for this request.
| confirmation_code required | string |
{- "activations": [
- {
- "id": "string",
- "user": {
- "email": "string",
- "msisdn": "string",
- "firstname": "string",
- "lastname": "string",
- "new_password_required": true
}, - "product": {
- "id": "string",
- "name": "string",
- "description": "string"
}, - "partner": {
- "id": "string",
- "title": "string",
- "confirmation_url": "string"
}, - "state": "UNCONFIRMED"
}
]
}Fetches all features from current user and his subscription.
| entity_type | string Value: "release" Type of the entities. If present |
| entity_id | Array of strings Сomma-separated list of entity IDs |
| name | string Filter features by name. Makes sense when |
{- "features": [
- {
- "entity_id": "string",
- "entity_type": "release",
- "name": "quota",
- "enabled": true,
- "properties": {
- "expiry_date": "2022-02-22 22:22:22"
}
}
]
}In order to use this endpoints normal OAuth flow should be used. Access token must have partner_manager scope,
so a separate client should be used to get the access tokens.
Adds a new partner with no authentication clients and no allowed products.
POST /v2/partners/:partner_id/clientsPUT /v2/partners/:id/products following this request.| title required | string title of the partner |
| confirmation_url required | string pattern of a URL that user should visit to confirm a subscription |
{- "title": "string",
- "confirmation_url": "string"
}{- "partner": {
- "id": "string",
- "title": "string",
- "confirmation_url": "string"
}
}Clients are used to authenticate partners' requests.
Every partner can have one or more clients.
Each client has client_id and client_secret that are
used to identify the partner.
After creating a new client client_id and client_secret should be sent to the partner, so they can use it.
| partner_id | integer |
| title required | string |
{- "title": "string"
}{- "client": {
- "title": "string",
- "client_id": "string",
- "client_secret": "string"
}
}Endpoints /v2/partnerusers/* are used by partners to manipulate theirs users
and users' subscriptions.
In order to use these endpoints a separate authentication method is used, different from the normal OAuth flow.
A partner is provided with a set of clients which credentials should be used to authenticate this partner.
Each request should contain following headers:
If no correct credentials were provided, the following response is sent
401 Unauthorized
{}
POST /v2/partnerusers/activations - creates a new user, associates with the partner and adds a subscription;DELETE /v2/partnerusers/activations/:activation_id - stop user's subscription.This is a primary endpoint to create and associate a user with the partner and add a partner subscription for this user.
user must be present in the request with valid email or msisdn for this case;| X-Auth-Client-Id | string |
| X-Auth-Client-Secret | string |
required | object |
object | |
required | object |
| state | integer Optional. If set to 2 and the user already has a running subscription for this partner, no confirmation is required |
{- "partneruser": {
- "external_id": "string"
}, - "user": {
- "email": "string",
- "msisdn": "string",
- "firstname": "string",
- "lastname": "string",
- "username": "string"
}, - "product": {
- "id": "string"
}, - "state": 0
}{- "activation": {
- "id": "string",
- "confirmation_url": "string"
}, - "user": {
- "id": "1234",
- "was_requested_password_applied": true,
- "was_user_created": true
}
}Full text search. Response can be paginated based on Range headers
| query | string full-text search |
| series_id | string search by series id |
| rated_by | string |
| media_available_from | string <Y-m-d> |
| licensor_id | string name of a licensor |
| banner_group_id | string Filter by releases that are converted to a banner group |
| release_group_id | string Filter by releases that are under control of a release group |
| X-Release-Cover-Sizes | string |
| X-Actor-Image-Sizes | string |
| X-Include | string |
| Range | string Example: artists=20-39 artists=20-39 (inclusive) |
{- "releases": [
- {
- "id": "string",
- "title": "string",
- "original_title": "string",
- "cover": {
- "release_id": 0,
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}, - "artist": {
- "id": "string",
- "name": "string",
- "url": "string"
}, - "actors": [
- {
- "id": "string",
- "name": "string",
- "sort_name": "string",
- "role": "string",
- "image": {
- "w50": "string",
- "h200": "string",
- "w200": "string",
- "w800": "string"
}
}
], - "type": "album",
- "favourite": true,
- "url": "string",
- "copyright": "string",
- "release_date": "1997-07-16",
- "language": "string",
- "description": "string",
- "prices": [
- [
- {
- "currency": "BDT",
- "price": 5.9
}
]
], - "notes": [
- {
- "id": "string",
- "summary": "string",
- "text": "string"
}
], - "reviews": [
- {
- "id": 0,
- "publication": "string",
- "publication_date": "string",
- "title": "string",
- "url": "string",
- "score": {
- "value": "string",
- "scale": {
- "min": 0,
- "max": 0
}, - "formatted": "3/6"
}
}
], - "rating": {
- "value": 5,
- "total": 0
}, - "series": {
- "id": "string",
- "release_number": 0
}, - "ids": {
- "^[a-zA-Z0-9]+$": "string"
}, - "genres": [
- [
- "string"
]
], - "media_available_from": "string",
- "chapters": [
- {
- "title": "string",
- "description": "string",
- "offset": 0
}
], - "technical_protections": [
- "string"
]
}
]
}| id required | string Release ID |
| purpose required | string Value: "export" |
| password required | string non-empty |
{- "purpose": "export",
- "password": "string"
}{ }