Unsubscribe
You can unsubscribe from the specified playlist.
Endpoint URL
/api/users/:user_id/playlist_subscriptions/:id
HTTP Method
DELETE
Authentication
OAuth 2.0: Access token required. See Authentication for examples and details.
Parameters
| Name | Required | Description | Example |
|---|---|---|---|
| user_id | required | The unique ID for the playlist. | 150470956064702464 |
Response Elements
| Response | Description |
|---|---|
| code |
Beats API response code. OK if successful; otherwise an error code is returned. |
Example Request
Suppose you would like to unsubscribe from a playlist to which you had previously subscribed: "Born to Run" is currently in your subscriptions, with playlist ID pl130560517973607168. If you don't have the playlist ID, you can use the Search API to retrieve it.
Since you are unsubscribing from this playlists on behalf of a user, you will need their user ID. Recall that when you first created a playlist for the user, a response containing the user ID was returned:
{
"data": {
...
},
"refs": {
...
"user": {
"ref_type": "user",
"display": "[YOUR_USER_NAME]",
"id": "150470956064702464"
},
...
}
"code": "OK"
}
You will need to provide the user ID, the playlist ID, and your access token. The general form of this API is:
curl -X DELETE "https://partner.api.beatsmusic.com/v1/api/users/[YOUR_USER_ID]/playlist_subscriptions/[PLAYLIST_ID]?
access_token=[YOUR_ACCESS_TOKEN]"
In this example we will subscribe the user to the playlist IDs you just retrieved:
curl -X DELETE "https://partner.api.beatsmusic.com/v1/api/users/150470956064702464/playlist_subscriptions/pl130560517973607168?
access_token=[YOUR_ACCESS_TOKEN]"
Example Response
Open the Beats Music app on your mobile device and select My Playlists > Subscriptions. You will see that the playlist "Born to Run" no longer appears in your subscriptions! You can also confirm what you have in your subscriptions by invoking the Subscriptions: User API.
Here is the API response indicating that you have successfully unsubscribed from the playlist:
{"code":"OK"}

