Forum Discussion
Rest API integration with Service Now getting refreshed tokens.
- 2 years ago
Managed to resolve this myself:
Added the Authorization = to body.
body = [grant_type="password", client_id=clientid, client_secret=clientsecret, username=un, password=pw, Authorization=Token],
Data=Json.Document(Web.Contents("https://[instance].service-now.com/oauth_token.do",[Headers=[#"Content-Type"="application/x-www-form-urlencoded"], Content=Text.ToBinary(Uri.BuildQueryString(body))])),
access_token = Data[access_token]
in
access_token
Hey richardc1 ,
I am also facing similar issue. I am able to fetch the token and convert it into function but when I replace the hardcoded bearer toekn with the function in main query it starts giving me authentication error.
Any help will be highly appriciated.!
So when you run the function, it spits out a bearer token no worries?
If so, then how are you calling that function in your fetch query?