These api endpoints allow to create and fetch timeline events for a user.
-
POST
/1/user/
(user_name)/timeline-event/create/notification
Post a message with a link on a user’s timeline. Only approved users are allowed to perform this action.
The request should contain the following data:
{
"metadata": {
"message": "<the message to post, required>",
}
}
Parameters: |
- user_name (
str ) – The MusicBrainz ID of the user on whose timeline the message is to be posted.
|
Status Codes: |
|
Response Headers: |
|
|
-
POST
/1/user/
(user_name)/timeline-event/create/recording
Make the user recommend a recording to their followers.
The request should post the following data about the recording being recommended:
{
"metadata": {
"artist_name": "<The name of the artist, required>",
"track_name": "<The name of the track, required>",
"recording_msid": "<The MessyBrainz ID of the recording, required>",
"release_name": "<The name of the release, optional>",
"recording_mbid": "<The MusicBrainz ID of the recording, optional>"
}
}
Parameters: |
- user_name (
str ) – The MusicBrainz ID of the user who is recommending the recording.
|
Status Codes: |
- 200 OK – Successful query, recording has been recommended!
- 400 Bad Request – Bad request, check
response['error'] for more details.
- 401 Unauthorized – Unauthorized, you do not have permissions to recommend recordings on the behalf of this user
- 404 Not Found – User not found
|
Response Headers: |
|
|
-
POST
/1/user/
(user_name)/feed/events/delete
Delete those events from user’s feed that belong to them.
Supports deletion of recommendation and notification.
Along with the authorization token, post the event type and event id.
For example:
{
"event_type": "recording_recommendation",
"id": "<integer id of the event>"
}
{
"event_type": "notification",
"id": "<integer id of the event>"
}
Parameters: |
- user_name (
str ) – The MusicBrainz ID of the user from whose timeline events are being deleted
|
Status Codes: |
|
Response Headers: |
|
|
Social¶
User Timeline API¶
These api endpoints allow to create and fetch timeline events for a user.
POST
/1/user/
(user_name)/timeline-event/create/notification
¶Post a message with a link on a user’s timeline. Only approved users are allowed to perform this action.
The request should contain the following data:
str
) – The MusicBrainz ID of the user on whose timeline the message is to be posted.response['error']
for more details.POST
/1/user/
(user_name)/timeline-event/create/recording
¶Make the user recommend a recording to their followers.
The request should post the following data about the recording being recommended:
str
) – The MusicBrainz ID of the user who is recommending the recording.response['error']
for more details.POST
/1/user/
(user_name)/feed/events/delete
¶Delete those events from user’s feed that belong to them. Supports deletion of recommendation and notification. Along with the authorization token, post the event type and event id. For example:
str
) – The MusicBrainz ID of the user from whose timeline events are being deletedresponse['error']
for more details.GET
/1/user/
(user_name)/feed/events
¶Get feed events for a user’s timeline.
str
) – The MusicBrainz ID of the user whose timeline is being requested.max_ts
timestamp, events with timestamps less than the value will be returnedmin_ts
timestamp, events with timestamps greater than the value will be returnedint
) – Optional, number of events to return. Default:DEFAULT_ITEMS_PER_GET
. Max:MAX_ITEMS_PER_GET
response['error']
for more details.Follow API¶
These apis allow to interact with follow user feature of ListenBrainz.
GET
/1/user/
(user_name)/followers
¶Fetch the list of followers of the user
user_name
. Returns a JSON with an array of user names like these:GET
/1/user/
(user_name)/following
¶Fetch the list of users followed by the user
user_name
. Returns a JSON with an array of user names like these:POST
/1/user/
(user_name)/unfollow
¶Unfollow the user
user_name
. A user token (found on https://listenbrainz.org/profile/ ) must be provided in the Authorization header!user_name
.POST
/1/user/
(user_name)/follow
¶Follow the user
user_name
. A user token (found on https://listenbrainz.org/profile/ ) must be provided in the Authorization header!user_name
.user_name
.