Cloud REST API authentication with API key

Esther Strom February 14, 2019

I'm trying to use Postman to access our cloud instance via REST. I clicked the "Run in Postman" button in the API docs, and it did import a collection into Postman. But in the auth, folder, the Create Session request continually returns 401. When I open the notes at the top, there's a link indicating that that particular endpoint was deprecated last year, with a link to this document.

So, if the only endpoint provided in the collection doesn't actually exist anymore, how do I authenticate via Postman using an API token? I think I can add a new request, but what should the endpoint be?

I'd love it if there were a video out there somewhere, but most of what I've found on YouTube is old enough to be out of date.

2 answers

1 vote
Doods Perea September 23, 2019

Hi @Esther Strom@Jamie C  - in Postman Authorization, use Basic Auth.  For username, use your email address.  For the Password, use the API Token you generated from https://id.atlassian.com/manage/api-tokens

 

Let me know if that worked for you.

W Bot February 22, 2020

Worked perfect for me! (No OP)..  Thanks Doods!

0 votes
Marty
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 14, 2019

Hi Esther,

I'm not part of the Jira or Confluence team, but I'll see if I can help.

You can still use Postman to test some endpoints (curl is another alternative that is not too much of a pain to learn).

I *think* the key difference is that you need to send an Authorization header with an API token instead of with a user password.  So if you setup an API token in your instance, then you can go to your Postman request and change the 'password' being using in the Authorization header.  I think the header is 'user:api_token'.

I hope that helps!

Esther Strom February 15, 2019

Thanks, I'll give that a shot. I'm new to Postman as well, so I'm not sure how much of the problem is setup vs actual API.

Jamie C
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!
June 24, 2019

Was there any update to this?  Since basic authentication was deprecated on June 5th I've run into issues (Auth deprecation).  I can create an API-Token but I don't know how to feed it into Postman in a way that works.  Simply putting the api-token as the password for basic authentication doesn't work.

Viktor Leandersson
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!
August 11, 2020

Same here

Doods Perea August 11, 2020

@Viktor@Jamie C  - would my September 23, 2019 answer above to the original post work for you?

Thanks!

Viktor Leandersson
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!
August 11, 2020

What threw me off was the depreciation on the Basic auth method from Jira (new since summer 2020). It does thou still work, and the key to success for me was to base64 encode the token + userName. This was easiest done with

curl -v https://myDomain.atlassian.net --user myEmail@asUsername.com:myApiKey --head

And then find the Authorization header that includes 

Authorization: Basic myBase64EncodedToken

I could then use this in both Postman and my Jira automation hooks :) 

Thanks thou @Doods Perea for the hints. Useful!

patriciaalejandra_gutierrez January 24, 2022

Buen día 

Me estaba funcionando perfecto, hasta ayer y no se que pudo pasar.

Suggest an answer

Log in or Sign up to answer