Segamoto
Segamoto

Reputation: 315

Spotify WebAPI URL Request Syntax

After last update about authorization it's still possible do get request for tracks? Before the update I've this request URL:

https://api.spotify.com/v1/tracks/4jTiyLlOJVJj3mCr7yfPQD

But now it returns:

{
  "error" : {
    "status" : 401,
    "message" : "No token provided"
  }
}

How can I do the call now with auth token? What is the syntax I've to use?

Upvotes: 1

Views: 210

Answers (1)

Tom Parker-Shemilt
Tom Parker-Shemilt

Reputation: 1697

You'll need to follow the Authorization Guide to get tokens and after that (as noted in "6. Use the access token to access the Spotify Web API") you can then add a "Authorization: Bearer <token>" header to your request.

FYI, this is all noted in the API reference for the Get a Track call you're making, under the "Authorization" section, which is noted as "Required. A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details."

Upvotes: 1

Related Questions