Hello,I am using a 3LO app.
When trying to POST to https://api.atlassian.com/ex/jira/{CloudID}/rest/api/3/issue i get the error "OAuth 2.0 is not enabled for this method"
The documentation for this endpoint shows the required OAuth scope of "write:jira-work", meaning the endpoint should support OAuth 2.0.
Other endpoints used so far by my project do not return this error.
Solution to my issue:I was indeed trying to `GET` instead of `POST` to the /rest/api/3/issue endpoint. Correcting the method resulted in a successful API call. What threw me off was that the message returned by the API was "OAuth 2.0 is not enabled for this method" and a code 500, instead of a 405 and something like "Method not supported for this endpoint".
Hello @Alex ,
Welcome to the Atlassian Community!
I can confirm that Oauth2 is enabled for the rest/api/3/issue endpoint and it is supposed to be working.
Therefore, in order to try to understand what is failing, can you kindly let me know the following:
Finally, for the future, please notice that this is not the best place to get help on development related questions. The right resources are the ones listed in https://developer.atlassian.com/resources.
Specifically:
Cheers,Dario
Hi Dario
1. Yes I did
2. I am also using the `GET /rest/api/3/project/{projectKey}/components` endpoint using the same authentication method, and it works without issue
3. My requests are sent to https://api.atlassian.com/ex/jira/{CloudID}/ as per the documentation: https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/#3--make-calls-to-the-api-using-the-access-token
I made a request that returned the OAuth not supported error on "Fri, 30 Jul 2021 17:12:11 GMT"
@Alex ,
I believe there is a misunderstanding on point #3.
I am not asking which endpoint url you are calling. I am asking against which one of the 2 Jira sites you have access to you are sending the REST API calls, so that I can go check the logs.
Please let me know.
@Dario B My apologies! I am sending to the appXXXXXX.jira.com site.
Hi @Alex ,
That's indeed a misleading error message. I can confirm that when using basic authentication and sending a GET request to the rest/api/3/issue endpoint (with no issue key and no request body) I get status code 405 in return, as expected.
I can proceed opening a bug request for it. Can you just confirm that the below description is correct?
When using Oauth2.0 (3LO) and sending a GET request to the rest/api/3/issue endpoint (with no issue key specified), status code 500 together with a misleading error message is returned: "OAuth 2.0 is not enabled for this method" The expected status code would be 405 and the error message: "Method not supported for this endpoint" When calling the same endpoint using basic authentication, as expected, status code 405 is returned instead.
When using Oauth2.0 (3LO) and sending a GET request to the rest/api/3/issue endpoint (with no issue key specified), status code 500 together with a misleading error message is returned: "OAuth 2.0 is not enabled for this method"
The expected status code would be 405 and the error message: "Method not supported for this endpoint"
When calling the same endpoint using basic authentication, as expected, status code 405 is returned instead.
However, before proceeding, can you confirm you get the same error message also if you call the same endpoint without providing any request body? (just send a GET request with no body towards the /rest/api/3/issue endpoint and confirm you get the same error message).
Hi,
Follow OAuth 2.0 (3LO) apps (atlassian.com) to get bearer token
1. If you are using swagger code for jira oauth 2.0. Then you have to keep in mind base path should be https://api.atlassian.com/ex/jira/{CloudID} and local path should be /rest/api/3/issue (Note : base path and local path should be correct )
add generated bearer token in request also.
2. If you are using postman then do authentication by bearer token.
Both things I have tried and got correct result.
Thanks
It looks like you're new here. Sign in or register to get started.