Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,863
Community Members
 
Community Events
185
Community Groups

Send web request Automation using x-www-form-urlencoded

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
Untitled.png

 

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

Untitled2.png

Untitled3.png

 

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  

2 answers

0 votes
Rik de Valk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 27, 2023

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: 

  • variableName = clientId
  • Smart value = y0urSup3rS3cret1D

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! 

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"}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events