Forum Discussion
Anonymous
5 years agoNot applicable
Connecting to an API that uses OAuth with Power Query
Hi All, I'm trying to ingest data from this API: https://api.nsw.gov.au/Product/Index/22 The site lets you test the endpoints in the browser and I get a valid response using the test credenti...
- 5 years ago
Hi Anonymous
That NSW Govt website is way too hard to use. It keeps giving me errors just trying to access it, like this
When I generate an access token on the website and then use it from the same website it tells me the access token is invalid.
Generate an Access Token
Make an API Call
Check the Response
If the Access Token the site itself is generating is being rejected then there's not much hope. I'm getting the same errors in Postman.
If I was you I'd be asking the website support what the issue is at their end.
Regards
Phil
UFP
2 years agoNew Member
Hi,
Allthough this thread is old. Thanks for the almost working example in this post.
I have replaced
AccessToken = Text.From(GetJson)with
AccessToken = Json.Document(GetJson)[access_token]Passing this AccessToken as the Bearer works for me.
Hope this helps others in the same situation,
Udo