Ratings
Look up multiple ratings for a user.
The ids can be of the following types:
- albums
- tracks
- playlists
Endpoint URL
/api/users/:user_id/ratings
HTTP Method
GET
Authentication
OAuth 2.0: Access token required. See Authentication for examples and details.
Parameters
| Name | Required | Description | Example | ||||||
|---|---|---|---|---|---|---|---|---|---|
|
user_id |
required | Unique ID for User. | 1234567890 | ||||||
|
ids |
optional | An array of IDs of rated items. | ids=tr649915&ids=pl568234 | ||||||
|
offset |
optional | Integer offset into results, 0 based. Defaults to 0. | 0 | ||||||
|
limit |
optional | Specifies the maximum number of records to retrieve. You are guaranteed to get at most this number of results, but you may get fewer. If set to zero or less, returns nothing. Maximum value is 200 (i.e., if greater than 200, returns only 200). If not supplied, defaults to 20. | 20 | ||||||
| order_by | optional | Indicates how the results set should be ordered. Defaults to “updated_at desc”. Valid Values (default is updated_at desc):
|
updated_at |
Response Elements
| Response | Description |
|---|---|
| code |
Beats API response code. If successful, code is 'OK'. Otherwise it will be an error code. |
| type |
The entity type of the API object |
| id |
Unique ID of the rating. |
| rating |
Value indicating a user’s rating of an item. Values are either 1, 0. 1 indicates a ‘love’ and 0 indicates a ‘hate’. |
| updated_at |
Epoch timestamp the given object was last updated at. |
| rated |
Object with keys corresponding to rated object types, and values providing the bare information needed for linking to the objects. |
|
ref_type |
The API object type of the item being referred to. |
|
id |
Unique ID of the referenced item. |
|
display |
Text to be displayed when showing a link to the referenced item. Note: this is always going to be blank. The field exists to be consistent with other ‘ref’ objects. |
Example Request
curl -X GET "https://partner.api.beatsmusic.com/v1/api/users/1234567890/ratings?
access_token=[ACCESS_TOKEN]"
Example Response
{
"code": "OK",
"data": [
{
"type": "rating",
"id": "al12345",
"rating": 1,
"updated_at": 1361468733,
"rated": {
"ref_type": "album",
"id": "al12345",
"display": ""
}
},
{
"type": "rating",
"id": "tr12345",
"rating": 0,
"updated_at": 1361468733,
"rated": {
"ref_type": "track",
"id": "tr12345",
"display": ""
}
},
{
"type": "rating",
"id": "tr123",
"rating": 1,
"updated_at": 1361468733,
"rated": {
"ref_type": "track",
"id": "tr123",
"display": ""
}
}
],
"info": {
"offset": 0,
"count": 3,
"total": 3
}
}

