Forums

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

How to use OAuth's access token?

javier_montilva August 28, 2020

Hi there. 

I was able to get the OAuth's access token and now I want to retrieve an issue from my project. I'm sending the access token as a header as follow: 

curl --request GET --header "Authorization: OAuth <access_token>" --url "https://example.atlassian.net/rest/api/2/issue/EXA-1"

But I'm getting the following error: {"errorMessages":["Issue does not exist or you do not have permission to see it."],"errors":{}}.

Am I missing any header o any other data?

1 answer

1 accepted

0 votes
Answer accepted
Prince Nyeche
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, 2020

Hi @javier_montilva 

I believe the header should be like:

--header "Authorization: Bearer <access_token>"

 and the URL should be like

https://api.atlassian.com/ex/jira/{cloudid}/rest/api/2/issue/EXA-1

 The cloudid should be obtained when you've authenticated your request through the /oauth/token/accessible-resources endpoint.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events