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
v-veshwara-msft
Community Support
1 year agoHi callahan_254 ,
We're following up to see if the solutions provided met your needs. If they did, please accept them as the solution to help others benefit. If you still need assistance, please don't hesitate to reach out. Thank you!