Unable to access JIRA API

dushyanth.pamala
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 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 @dushyanth.pamala ,

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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 30, 2019

@dushyanth.pamalaCan 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

dushyanth.pamala
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 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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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