so in postman i have this POST REQUEST METHOD with the following urlencoded
POST -> URL: www.xxxxxxxxx.xxx/api/now/get_token_here
Body -> x-www-form-urlencoded
grant_type = password
client_id = client_id
client_secret = client_secret
username = username
password = password
now on my headers
Now I am trying to use automation wherein I can get the {{weebhookResponse.body.access_token}} then put it on another send web request automation like this
now it always gets me an error on the first send web request wherein I cannot get the token because it is giving me a 401 though it is working on the POSTMAN. Kindly help
Hi @ginxx009 , considering how long ago you posted this, you might have either fixed it, or given up :)
But I stumbled upon your question because I was struggling with it myself.
It looks like you're initiating an OAuth flow to get a refresh token.
I've managed to do this with Jira automation in this way:
Create one action per parameter 'Create variable'. For example:
You do the same for clientSecret and password.
After that you create the Send Webrequest action, with the header:
Content-Type = application/x-www-form-urlencoded
And a Custom body like this where you put your parameters using your variables with the addition of the .urlEncode function for Smart Values. Your body would look somewhat like this:
grant_type=password&client_id={{clientId.urlEncode}}&client_secret={{clientSecret.urlEncode}}&username=api_user_sn_chg_rest&password={{password.urlEncode}}
Happy Friday!
Thanks for the post.. saved me a lot of time figuring out. Wanted to connect with Stibo STEP and managed to do so with this help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
forgot to share the error
Send web request
Error publishing web request. Response HTTP status:
401
Error response HTTP body:
{"error_description":"access_denied","error":"server_error"}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.