Forums

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

Unable to access JIRA API

Deleted user August 30, 2019

HI Team,

 

We are trying to access JIRA using the below API using Basic Auth. How every i am getting 401 Unauthorized error

COuld you please help me how can i troubleshoot this issue 

https://balajichandrashekar.atlassian.net/jira/agile/latest/issue/AT-1

2 answers

2 accepted

0 votes
Answer accepted
Rafael Pinto Sperafico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 30, 2019

Hi @[deleted] ,

Based on the URL you have posted, it seems you are attempting on running the REST API endpoint described on https://developer.atlassian.com/cloud/jira/software/rest/#api-rest-agile-1-0-issue-issueIdOrKey-get

Under the Examples section you shall find different ways of calling the HTTP Request GET method (e.g cURL, Node.js, Java, Python, PHP).

As @DPKJ suggested, you will require an API Token to authenticate your user when calling the REST API endpoint mentioned, for that visit https://confluence.atlassian.com/cloud/api-tokens-938839638.html as mentioned on this post.

Kind regards,
Rafael

0 votes
Answer accepted
DPKJ
Community Champion
August 30, 2019

@[deleted]Can you share curl/script that you using?

 

Also you need to specify, <email>:<api_token> in basic auth not <username>:<password> if you are doing that mistake.

Read this for API Tokens - https://confluence.atlassian.com/cloud/api-tokens-938839638.html

Deleted user August 30, 2019

This is first time we are trying something with JIRA API, hence we are not using any scripts.

I ready some documents, based on the documents i framed this API and used it.

Could you help me with some basic GET operation to get of a project and Tasks please 

DPKJ
Community Champion
August 30, 2019

Here is an example using curl to get issue,

curl -D- -u <EMAIL>:<API_TOKEN> -X GET -H "Content-Type: application/json" https://<SITE_NAME>.atlassian.net/rest/api/3/issue/<ISSUE_ID_OR_KEY>

To get list of project

curl -D- -u <EMAIL>:<API_TOKEN> -X GET -H "Content-Type: application/json" https://<SITE_NAME>.atlassian.net/rest/api/3/project/<PROJECT_ID_OR_KEY>

To find more api look here - https://developer.atlassian.com/cloud/jira/platform/rest/v3/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events