Unable to search issues using rest oauth

Frédéric Esnault October 10, 2019

Hello Community !

I'm facing an issue with the REST Api while trying to search issues in a Jira Cloud instance.

I'm using the Java Rest Client from Atlassian.

I created an App and allowed it for my cloud jira, then created a code/state, generated a token, and tried to test some Rest queries, which worked.

For example, a list of project works well :

curl --request GET --url https://api.atlassian.com/ex/jira/(cloud_id)/rest/api/2/project --header 'Authorization: Bearer (token)' --header 'Accept: application/json'

But when I try to search for issues, it won't work.

Here is the query :

curl --request GET --url https://api.atlassian.com/ex/jira/(cloud_id)/rest/api/latest/search?jql=project%3DMSHUK&expand=schema,names&maxResults=0&startAt=0 --header 'Authorization: Bearer (token)' --header 'Accept: application/json'

And the error :

{"errorMessages":["OAuth 2.0 is not enabled for this method."]}

 

1 answer

1 accepted

0 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 23, 2019

Hi Frederic,

I understand that you are using the java rest client in an app, but getting back an error in regards to the REST API endpoint that app is trying to call.  Sorry for the inconvenience here, it seems that this has been documented as a bug.  Please see JRACLOUD-72126  for more details.

This particular bug appears to happen when called the /api/latest/ but does not seem to be happening when calling either the /api/2/ or /api/3/ (beta) endpoints.  As such, perhaps you can work around this problem by explicitly calling either the v2 or v3 endpoint instead of using the latest URI here.

I hope this helps.

Andy

Frédéric Esnault October 24, 2019

Oh thanks for the answer Andy,

I'll try this as soon as possible, but it seems to fit the issue I'm facing.

Frédéric Esnault March 10, 2020

Works fine, thanks !

Like Dario B likes this
Sharma, Bhupendra (Contractor) May 24, 2022
I am using postman and providing API key in authorization(Bearer token) and getting below massage.
Also using parameter as ''emailAddress'' =value(user email address)
Error massage - ''OAuth 2.0 is not enabled for method: POST /rest/api/3/user" 

Suggest an answer

Log in or Sign up to answer