I keep getting 401 Unauthorized when trying to GET https://api.atlassian.com/jsm/insight/workspace/{WorkspaceID}/v1/iql/objects
Actually anything under https://api.atlassian.com/jsm/insight/workspace/{WorkspaceID}/v1/ returns a 401 at this point
At this point I'm not sure which URL and Auth method I should be using tbh. The documentation seems a bit obscure Which documentation should I be looking at?Huge thanks in advance
Hi Dalmiro,
Sorry to hear about this problem. It looks like you're using Jira Cloud, but the document you reference here appears to be the older server edition of Insight. For Jira Service Management Cloud's Insights API, please check out https://developer.atlassian.com/cloud/insight/intro/introduction-and-basics/
It has a brief overview of how authorization is expected depending on the types of calls being made here. But then it also has a link to the detailed endpoints documentation such as https://developer.atlassian.com/cloud/insight/rest/
Try that and let me know if you run into any problems here.
Andy
Thanks for getting back to me Andy
Based on that doc I should be able to GET https://api.atlassian.com/jsm/insight/workspace/[workspaceID]/v1/iql/objects , right?
If I do the above I keep getting 401s even though:
Am I lacking some kind of permission that only matters at an API level? If so, is there some doc that I can send my administrators to convince them to get me the permissions?
Thanks!
Yes, that call should work. There is no separate API permission restriction to my knowledge. If your account can view this information in the web GUI, then making REST calls with the same account credentials should return the same results.
But if you're seeing a 401 error, this is a pretty clear indication that authorization is either failing or your account here doesn't have the ability to see this.
Which method to authenticate to the REST API are you using in your call? (Basic Auth, OAuth, a Connect or Forge App, etc?)
I'm using Basic Auth with my company email and a token I created for this task. I'm getting the same result from Postman and regular Curl
curl -D- \-u my.user@company.com:P4$$w0Rd \-X GET \-H "Content-Type: application/json" \https://api.atlassian.com/jsm/insight/workspace/{WorkspaceID}/v1/iql/objects
HTTP/2 401server: envoycache-control: no-cache, no-store, max-age=0, must-revalidatestrict-transport-security: max-age=315360000; includeSubDomains; preloaddate: Thu, 04 Nov 2021 21:19:44 GMTx-request-id: 28c8a05cb7526bf4expires: 0pragma: no-cachex-xss-protection: 1; mode=blockx-envoy-upstream-service-time: 78x-content-type-options: nosniffx-trace-id: 28c8a05cb7526bf4x-frame-options: SameOriginexpect-ct: report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/global-proxy", enforce, max-age=86400content-length: 0
Another thing that confuses me is that all the GET calls I see when browsing Insight from JIRA and the browser`s developer tools look like this one:
https://insight-cloud.riada.io/rest/insight/1.0/global/config/object?objectschemaid=1&objecttypeid=7&_=1636060927480
Is that rool URL the expected one?
It looks like you're new here. Sign in or register to get started.