Forum Discussion
Pull data from web service using POST method
Please try this instead. You need to make a record in your contents step.
= let
url="https://accounts.zoho.com/oauth/v2/token",
contents=[refresh_token="1000.1affXXXXXXXXXXXXXX",
client_id="1000.WRXXXXXXXx",
client_secret="10f6aaXXXXXXXXXX",
grant_type="refresh_token"
],
result=Web.Contents(url,[Content=Json.FromValue(contents)]),
Final=Json.Document(result)
in
Final
Pat
- akashgera5 years agoHelper I
Thanks for the response, I've tried with the below query as well, but still getting the same error: invalid_client
let
url="https://accounts.zoho.com/oauth/v2/token",
contents=[refresh_token="1000.1afXXXXXXXXXXXXXX",
client_id="1000.WXXXXXXXXXXXXXXXX",
client_secret="10fXXXXXXXXXXXX",
grant_type="refresh_token"
],
result=Web.Contents(url,[Content=Json.FromValue(contents)]),
Final=Json.Document(result)in
Final- mahoneypat5 years agoMicrosoft Employee
Not sure what the issue is but you can just hard code the whole url like this. I saw the redirecturi in the documentation and see that you didn't have it (not sure if needed or not). If this works, but you then have scheduled refresh issue, you can use the RelativePath and/or query paramters of Web.Contents.
let
url="https://accounts.zoho.com/oauth/v2/token",
refreshtoken="1000.1affXXXXXXXXXXXXXX",
clientid="1000.WRXXXXXXXx",
clientsecret="10f6aaXXXXXXXXXX",
granttype="refresh_token",
redirecturi = "????",
finalurl = "https://accounts.zoho.com/oauth/v2/token?refresh_token=" & refreshtoken & "&client_id=" & clientid & "&client_secret=" & clientsecret & "&redirect_uri=" & redirecturi & "&grant_type=" & granttype,
result=Web.Contents(finalurl),
Final=Json.Document(result)in
FinalPat
- akashgera5 years agoHelper I
After checking again with the API docs, redirecturi is not the mandatory parameter to pass in the request call, As Postman is giving me the correct response without using redirecturi parameter that means, there is something wrong with my written query, I've followed your above written query, but now it is showing : Web.Contents failed to get contents from 'https://accounts.zoho.com/oauth/v2/token/?