Forums

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

Jira Api Authentication 404 on GET Request

Nick Andrew
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 8, 2019

Overview

We are trying to get API Authentication working for our Jira Cloud instance.

So far we have tried to call a simple GET endpoint to get the details of a ticket in both Salesforce Dev Console and in Restlet. Every time we try it, though, we get a 404 error. When trying to call the endpoint in Restlet if I'm logged into Jira in the browser at the time, it will work presumably because it uses my session credentials in the browser.

It seems very clearly to be an authorization issue of some kind, but we cannot figure out what is failing because we don't get much information in the response.

Details

Endpoint: "https://<OurSandboxUrl>.atlassian.net/rest/api/3/issue/<IssueKey>"

Header: "Authorization: BASIC <Base64EncodedUserNameAndAPIToken>"

Method: GET

Other Things We've Tried

Went through our Project permissions and added the user we're trying to authenticate with to have permissions for every possible action one can perform on an Issue/Ticket.

1 answer

1 accepted

1 vote
Answer accepted
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 9, 2019

Hi Nick,

This took a bit of trial and error but I think i figured this out for you, and after some testing and comes down to the "BASIC" pre-flag in the auth header being case sensitive when your not logged in.  I tried out the same call on my test site using a few different methods while I was logged out and logged in using the Restlet Client.  

Where I was able to trigger the 404 when logged out but I could still trigger a 200 ok when logged in was if i removed the "Basic" pre prompt in the authorization header by overwriting it with the base64 encoded user:token string Or if I use all caps "BASIC" , EXE:

This Config failed with a 404 when logged out of the Jira cloud account using either capitalized "BASIC <Base64EncodedUserNameAndAPIToken>" or just the "<Base64EncodedUserNameAndAPIToken>" :

Screen Shot 2019-04-09 at 3.23.45 PM.png AND Screen Shot 2019-04-09 at 4.04.08 PM.png

But While Logged out the following Config Worked with a 200 ok status noting the "Basic" flag is present with capital "B" and lowercase "asic" in the Authorization header field before the encoded name:token variable:

Screen Shot 2019-04-09 at 3.22.12 PM.png

BUT on the next screenshot I was logged into jira and similar to what you noted when logged into jira just using the base64 encoded name:token does work without the "Basic" pre flag or capitalized "BASIC":

Screen Shot 2019-04-09 at 3.39.57 PM.png  AND  Screen Shot 2019-04-09 at 4.08.24 PM.png

Regards,
Earl

Nick Andrew
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 9, 2019

That's exactly what it was! I really appreciate the time you put into this answer.

Like Earl McCutcheon likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events