core-api / python-raml-codec

A RAML codec for Core API.
Other
3 stars 3 forks source link

Note unauthenticated spotify access in docs. #7

Open tomchristie opened 8 years ago

tomchristie commented 8 years ago

We're using spotify as an example service, but not authenticating with it. We should note this in the docs, and talk about how to handle authentication in this case.

s0l4r commented 7 years ago

Very useful service!

I am testing the coreapi against Spotify, but I get

coreapi action users users-profile -p user_id=xxx <Error: 401 Unauthorized> error: { message: "No token provided" status: 401 }

How do I authenticate to the API properly using Spotify client id and client secret?

tomchristie commented 7 years ago

I believe when I wrote this that unauthenticated access returned a subset of functionality, eg. search. Could be that the policy has changed? Anyone else replicate the behavior above?

s0l4r commented 7 years ago

Yep, it looks like all the requests, including search, requires authentication. https://developer.spotify.com/web-api/authorization-guide/

s0l4r commented 7 years ago

I just tested this, and it seems to work: coreapi headers add Authorization "Bearer xxxxxxxx"

I generated the token outside coreapi though (using spotipy https://spotipy.readthedocs.io/en/latest/), I guess there is no built in support to provide Spotify client_id and client_secret?