Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation Send Web request failing

Roger Jordan Pérez November 28, 2023

Hello,

I am trying to get the total issues number from a project using this API call.

Screenshot 2023-11-28 133523.png

But using the same call with the same Authorization headers inside a automation with the "send web request" option fails.

Screenshot 2023-11-28 134139.png

I have no clue why the endpoint works correctly when done with an external tool and it fails when done inside an automation using the web request option.

Any idea?

Thanks in advance.

 

2 answers

1 accepted

1 vote
Answer accepted
Charlie Misonne
Community Champion
November 28, 2023

Hi @Roger Jordan Pérez 

I do think this is an authenticatoin issue even though you mentioned your are using the same headers. Can you doubble check that?

You need this format: <email>:<api_token>. You have to base64 encode this whole string.

And then you use it in the header: "Authorization: Basic <base64 string>

I sometimes forget the Basic keyword in front of my string.

Roger Jordan Pérez November 28, 2023

You are right, it was an authentication issue.

The problem was that I wrote base rather than Basic, probably some mistake when copying and pasting at some point of the test.

 

Thanks so much

Charlie Misonne
Community Champion
November 28, 2023

glad I could help!

0 votes
Melissa C
Contributor
February 7, 2024

@Charlie Misonne 

 

Hello! can you give me some suggestions?

I'm getting an error message and I can't figure it out

2024-02-07_16-21-23.jpg

Charlie Misonne
Community Champion
February 9, 2024

Hi Melissa,

You can not use your username and token in plain text like that in the Authorization header. You need to send the username:password combination in base64 format.

You can use this site for example: https://www.base64encode.org/

If your username is JaneDoe and your token is Secret123 you need to enter JaneDoe:Secret123. This becomes SmFuZURvZTpTZWNyZXQxMjM= in base64 format.
Your header value is then: Basic SmFuZURvZTpTZWNyZXQxMjM= and not Basic JaneDoe:Secret123

Something else: you should not include the colons (:) in the header names.

Hope this helps!

Suggest an answer

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

Atlassian Community Events