Forum Discussion
Connect to a Web Service sending parameters
- Anonymous9 years ago
got my query working.
Thanks everyone.
got my query working.
Thanks everyone.
Hi,
I am trying to connect Power BI to the Spotify API, but somehow struggling to get it work.
Trying to use some code of this thread, but ending up with the following error message:
DataSource.Error: Web.Contents failed to get contents from 'https://accounts.spotify.com/api/token?grant_type=client_credentials' (405): Method Not Allowed
Details:
DataSourceKind=Web
DataSourcePath=https://accounts.spotify.com/api/token
Url=https://accounts.spotify.com/api/token?grant_type=client_credentials
The code I used was:
let
url="https://accounts.spotify.com/api/token?grant_type=client_credentials",
auth_key = "BASIC <Base64encoded clientID and secret",
header= [#"Authorization" = auth_key,
#"Content-Type" = "application/json; charset=utf-8"],
webdata = Web.Contents(url , [Headers=header]),
response = Json.Document(webdata)
in
response
Any suggestions on how to make this work?
Thanks!!!