Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Using OAuth with Insight REST API

dnechayev June 28, 2022

Insight docs say that Insights REST API supports the same authentication methods as Jira REST API. I was trying to make it authenticate via OAuth and could not make it work

I am using Cloud Jira (https://<org>.atlassian.net/) and generated OAuth tokens for that URL and I am using Insight REST API through this API - 

Obviously the token generated for https://<org>.atlassian.net/ is not working for https://api.atlassian.com/jsm/insight/workspace/<workspace_id>. I tried to generate the token for the latter URL - but it is not clear what relative paths should be used to get access credentials. 

Any pointers/ideas would be greatly appreciated

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 8, 2022

Hi,

I understand you are trying to use OAuth to authenticate in order to use the Insight REST API endpoints.  For other auth methods like basic auth, you can just call the direct cloud site, (ex https://example.atlassian.net )

However when using OAuth 2.0, the calls are directed to a different site, and with a different URL structure.  This is explained in https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#authentication

Instead of trying to call https://api.atlassian.com/jsm/insight/workspace/<workspace_id>

Try instead to call in the format of https://api.atlassian.com/ex/jira/<cloudId>/rest/api/3/<resource-name>

 

which in your case the URL to call would look something more like this:

https://api.atlassian.com/ex/jira/<cloudId>/jsm/insight/workspace/{workspaceId}/v1/object/{id}

I recommend walking through the steps in OAuth 2.0 (3LO) apps in order to make sure that you have configured the authorization correctly here.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events