Spotify Web API
  1. category-library
Spotify Web API
  • category-albums
    • Get Multiple Albums
      GET
    • Get an Album
      GET
    • Get an Album's Tracks
      GET
  • category-artists
    • Get Multiple Artists
      GET
    • Get an Artist
      GET
    • Get an Artist's Albums
      GET
    • Get an Artist's Related Artists
      GET
    • Get an Artist's Top Tracks
      GET
  • category-tracks
    • Get Audio Analysis for a Track
      GET
    • Get Audio Features for Several Tracks
      GET
    • Get Audio Features for a Track
      GET
    • Get Several Tracks
      GET
    • Get a Track
      GET
  • category-browse
    • Get All Categories
    • Get a Category
    • Get a Category's Playlists
    • Get All Featured Playlists
    • Get All New Releases
    • Get Recommendations
    • Get Recommendation Genres
  • category-episodes
    • Get Multiple Episodes
    • Get an Episode
  • category-markets
    • Get Available Markets
  • category-users-profile
    • Get Current User's Profile
    • Get a User's Profile
  • category-library
    • Remove Albums for Current User
      DELETE
    • Get User's Saved Albums
      GET
    • Save Albums for Current User
      PUT
    • Check User's Saved Albums
      GET
    • Remove User's Saved Episodes
      DELETE
    • Get User's Saved Episodes
      GET
    • Save Episodes for User
      PUT
    • Check User's Saved Episodes
      GET
    • Remove User's Saved Shows
      DELETE
    • Get User's Saved Shows
      GET
    • Save Shows for Current User
      PUT
    • Check User's Saved Shows
      GET
    • Remove User's Saved Tracks
      DELETE
    • Get User's Saved Tracks
      GET
    • Save Tracks for User
      PUT
    • Check User's Saved Tracks
      GET
  • category-follow
    • Unfollow Artists or Users
    • Get User's Followed Artists
    • Follow Artists or Users
    • Get Following State for Artists/Users
    • Unfollow Playlist
    • Follow a Playlist
    • Check if Users Follow a Playlist
  • category-player
    • Get Information About The User's Current Playback
    • Transfer a User's Playback
    • Get the User's Currently Playing Track
    • Get a User's Available Devices
    • Skip User’s Playback To Next Track
    • Pause a User's Playback
    • Start/Resume a User's Playback
    • Skip User’s Playback To Previous Track
    • Add an item to queue
    • Get Current User's Recently Played Tracks
    • Set Repeat Mode On User’s Playback
    • Seek To Position In Currently Playing Track
    • Toggle Shuffle For User’s Playback
    • Set Volume For User's Playback
  • category-playlists
    • Get a List of Current User's Playlists
    • Get a Playlist
    • Change a Playlist's Details
    • Get a Playlist Cover Image
    • Upload a Custom Playlist Cover Image
    • Remove Items from a Playlist
    • Get a Playlist's Items
    • Add Items to a Playlist
    • Reorder or Replace a Playlist's Items
    • Get a List of a User's Playlists
    • Create a Playlist
  • category-personalization
    • Get a User's Top Artists and Tracks
  • category-search
    • Search for an Item
  • category-shows
    • Get Multiple Shows
    • Get a Show
    • Get a Show's Episodes
  1. category-library

Save Albums for Current User

PUT
/me/albums
category-library
Save one or more albums to the current user's 'Your Music' library.
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://api.spotify.com/me/albums?ids=' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "ids": [
        "string"
    ]
}'
响应示例响应示例
200 - 示例 1
{
  "error": {
    "message": "string",
    "status": 0
  }
}

请求参数

Query 参数
ids
必需
A comma-separated list of the Spotify IDs. For example: ids=4iV5W9uYEdYUVa79Axb7Rh,1301WleyT98MSxVHPZCA6M. Maximum: 50 IDs.
Header 参数
Authorization
必需
A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.
Modification of the current user's "Your Music" collection requires authorization of the user-library-modify scope.
Content-Type
可选
Required if the IDs are passed in the request body, otherwise ignored. The content type of the request body: application/json
Body 参数application/json
ids
array[string]
可选
A JSON array of the Spotify IDs. For example: ["4iV5W9uYEdYUVa79Axb7Rh", "1301WleyT98MSxVHPZCA6M"]
A maximum of 50 items can be specified in one request. Note: if the ids parameter is present in the query string, any IDs listed here in the body will be ignored.
示例

返回响应

🟢200成功
application/json
Body
error
object (ErrorObject) 
可选
message
string 
可选
A short description of the cause of the error.
status
integer <int32>
可选
The HTTP status code (also returned in the response header; see Response Status Codes for more information).
🟢201On success, the HTTP status code in the response header is `201` Created. On error, the header status code is an [error code](https://developer.spotify.com/documentation/web-api/#response-status-codes) and the response body contains an [error object](http
上一页
Get User's Saved Albums
下一页
Check User's Saved Albums
Built with