Hi,
I'm trying to make a call to JIRA rest api using the API token from Postman,
I have created the API token from API token,
Now when I send a request to,
https://abc.atlassian.net/rest/api/3/issue
with body
{
"auth": {
"bearer": "<my_token>"
}
}
it should return all issues, but in real it is returning a 401 unauthorized error. Any help will be appreciated,
Thanks
Note:
token is generated from the admin account.
Not able to answer this for you, but I am also experiencing this problem.
I had a stable integration running that has not changed but suddenly stopped working on Monday
I also have the same problem on postman when I am trying to post a request to create a issue. I am using the jira server version, not cloud.
Headers: Content-Type applicaiton/Json, Authorization Basic encodeusername:api token.
URL: http://localhost:8080/rest/api/2/issue
Any idea what is wrong of my request?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Very oddly, I was previously calling the api with curl like this:
curl -v "https://mysite.atlassian.net/rest/api/2/search?jql=project=ABC+and+issueKey+in+(ABC-123)&fields=summary" -H "Authorization: Basic MY-API-TOKEN"
Which was working fine until Monday, since which I have been receiving a 401 response.
Reading the official support documentation on the api tokens page (https://confluence.atlassian.com/cloud/api-tokens-938839638.html) they advise to use your username and password colon separated on the user param e.g.:
curl -v https://mysite.atlassian.net --user me@example.com:my-api-token
This did not work for me.
Further reading (https://community.atlassian.com/t5/Jira-questions/JIRA-Rest-API-authentication-always-returns-401-unauthorized/qaq-p/187181), advised the approach is to use your username and password colon separated and then base64 encode it e.g.
me@company.com:MY-API-TOKEN
This base64 encode is (using https://www.base64encode.net/):
bWVAY29tcGFueS5jb206TVktQVBJLVRPS0VO
Therefore the curl request would then be:
curl -v "https://mysite.atlassian.net/rest/api/2/search?jql=project=ABC+and+issueKey+in+(ABC-123)&fields=summary" -H "Authorization: Basic bWVAY29tcGFueS5jb206TVktQVBJLVRPS0VO"
And this worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With using Postman, all you need do is in the Headers tab, create a `Authorization` header with value `Basic encodedusername:apikey` e.g.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Basic has been deprecated. You need to use another authentication mechanism, but the real question was related to the Bearer token, I am facing the same issue. Any luck here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.