Favourites
About
A favourite resource identifies a station that has been favourited by the authenticated user.Methods
The API supports the following methods, all of which require a valid access token:
Method | Endpoint | Description |
---|---|---|
GET | /favourites | Retrieves a list of favourite stations on behalf of the authenticated user. |
POST | /favourites | Adds a station to the authenticated user's favourites. |
DELETE | /favourites/$STATION_ID | Removes a station from the authenticated user's favourites. |
GET /favourites
Request
GET http://marxoft.co.uk/api/cuteradio/favourites
Parameters
Name | Description |
---|---|
limit | integer The maximum number of results that should be returned. Must be between 1 and 50. The default is 20. |
offset | integer The index of the first result to be returned. The index is 0-based. |
Response
{
"items": [
$STATION
],
"next": "/favourites?limit=20&offset=20"
}
Errors
Error type | Description |
---|---|
403 - Forbidden | No valid access token was provided. |
POST /favourites
Request
POST http://marxoft.co.uk/api/cuteradio/favourites
Request body
Name | Description |
---|---|
stationId | integer The unique identifier of the station to be added to the authenticated user's favourites. |
Response
The API will return a station resource.Errors
Error type | Description |
---|---|
403 - Forbidden | No valid access token was provided. |
404 - Not found | The station identified by the 'stationId' could not be found. |
DELETE /favourites/$STATION_ID
Request
DELETE http://marxoft.co.uk/api/cuteradio/favourites/$STATION_ID
Response
The API will return a 204 response code.Errors
Error type | Description |
---|---|
403 - Forbidden | No valid access token was provided. |
404 - Not found | The station does not exist in the authenticated user's favourites. |