Add Items to a Playlist
POST
/playlists/{playlist_id}/tracks
category-playlists
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.spotify.com/playlists//tracks' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw ''
响应示例响应示例
200 - 示例 1
{
"error": {
"message": "string",
"status": 0
}
}
请求参数
Path 参数
playlist_id
必需
Query 参数
position
可选
position=0
; to insert the items in the third position: position=2
. If omitted, the items will be appended to the playlist. Items are added in the order they are listed in the query string or request body.uris
可选
uris=spotify:track:4iV5W9uYEdYUVa79Axb7Rh, spotify:track:1301WleyT98MSxVHPZCA6M, spotify:episode:512ojhOuo1ktJprKbVcKyQ
A maximum of 100 items can be added in one request. Note: it is likely that passing a large number of item URIs as a query parameter will exceed the maximum length of the request URI. When adding a large number of items, it is recommended to pass them in the request body, see below.
Header 参数
Authorization
必需
Adding items to the current user's public playlists requires authorization of the
playlist-modify-public
scope; adding items to the current user's private playlist (including collaborative playlists) requires the playlist-modify-private
scope. See Using Scopes.Content-Type
必需
application/json
Body 参数application/json
返回响应
修改于 2021-08-02 10:49:34