Forum Discussion
callahan_254
1 year agoNew Member
Power Query REST API error
I'm working on a Power Query script in Excel to fetch data from the QGenda API. I'm encountering an error in the first part of my code, which is supposed to retrieve an authentication token. I've al...
- 1 year ago
Change your data source setting accordingly. You need to clear permissions as they are cached.
- 1 year ago
The error occurs because Web.Contents with Content requires a RelativePath. Use this fixed script:
let base_url = "https://api.qgenda.com", url_login = "/v2/login", body = [ email = "emailaddress", password = "password" ], encodedBody = Text.ToBinary(Uri.BuildQueryString(body)), response_login = Web.Contents(base_url, [ RelativePath = url_login, Headers = [#"Content-Type" = "application/x-www-form-urlencoded"], Content = encodedBody ]), jsonResponse = Json.Document(response_login), accessToken = jsonResponse[access_token], OutputToken = accessToken in OutputToken
lbendlin
Super User
1 year agoChange your data source setting accordingly. You need to clear permissions as they are cached.