Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,367,821
Community Members
 
Community Events
168
Community Groups

REST APIs return 401 Error

Edited
Michael I'm New Here Aug 08, 2022

I am currently using the Jira Free plan and attempting to add some integrations use Rest APIs. 

I have tested using the below postman collection as well as from a nodeJS application.
https://www.postman.com/api-evangelist/workspace/atlassian-jira/collection/35240-63247d50-9c97-4b50-a548-d9c42b2bcd17?ctx=documentation

When using correct authentication details I get a 401 error with message "

"You do not have permission to create issues in this project." when trying to create an issue ({{baseUrl}}/rest/api/3/issue) or a 404 error with message "
"Issue does not exist or you do not have permission to see it." when trying to get an issue.

I know the authentication details (email and token) are correct because if I change it to an invalid value I will receive a different error. The authentication details are for a user that has full access in the Jira site and can view and create issues on all projects. Using the APIs also updates the 'Last accessed' time on https://id.atlassian.com/manage-profile/security/api-tokens

Is there some secret setting I need to change to allow Rest API for a user?


 

1 answer

Hello @Michael

Thank you for reaching out.

I checked your postman settings and everything seems to be in the right place for the REST API to work, although you obviously can not provide the exact API call and authentication details.

That being said, I suggest checking the following details:

  1. Create and use a new API token.
  2. Confirm you have added the correct URL in the call. using the get method, ensure it is in the following format:
    https://yourdomain.atlassian.net/rest/api/3/issue/issueIdOrKey
  3. Have you tried to get issues directly from your browser (Using https://yourdomain.atlassian.net/rest/api/3/issue/issueIdOrKey) while you're logged in with the user account? Would you be able to try this?
  4. Double check the user account is properly able to access the issue

You can watch the video below to double-check if you have missed any postman parameters:

https://www.youtube.com/watch?v=eCXNHzP9FMQ

P.S: The authorization header is automatically filled when you set the basic auth.

Let us know if you have any questions.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS

Atlassian Community Events