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.
Header: "Authorization: BASIC <Base64EncodedUserNameAndAPIToken>"
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.
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>" :
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:
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":
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events