Forums

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

Public API to get cloud/site ID

Valerie May Villuga January 9, 2024

Hi,

We have this requirement in our application to redirect to User Management > Groups whenever we click a certain link. Part of the URL for this page is the cloud id https://admin.atlassian.com/s/cloud_id_here/users?productUse=jira-software 

user management.png

I have tried the solution provided here https://confluence.atlassian.com/jirakb/how-to-find-cloud-site-id-1272283178.html but it will throw an error when called from the application. So I was wondering if there is there any available rest API that we can use to retrieve the value for this? 

Thank you in advance.

 

1 answer

0 votes
Gabriel Rodrigues January 10, 2024

Hi @Valerie May Villuga ,

What error are you encountering when making a request to https://your-domain.atlassian.net/_edge/tenant_info from your application? This should returns a JSON with the cloudId attribute. According to the documentation, this is the method for retrieving the cloudId of a specific instance. 

Valerie May Villuga January 18, 2024

When I access the API thru the browser, I actually get a successful response with the cloud id but when I try to request thru our app with AP.context(..) which adds this additional parameter ?_r=1705633321612 in the URL, I get a 403 error (Please see attached image). Same case happens when I access it thru the browser with this exact URL https://my-domain.atlassian,net/_edge/tenant_info?_r=1705633321612

site-id-error.png

Matthias Clasen
Atlassian Partner
March 1, 2024

Hi @Valerie May Villuga

maybe you already solved this problem, but you are right that there are no query parameters allowed. You could also simply rely on a `fetch` call instead of `AP.context()`, because you don't need any authentication to retrieve the `cloudId`.

Like Valerie May Villuga likes this
Valerie May Villuga March 13, 2024

It didn't work using `fetch` because of CORS error but successfully requested using a backend API. Thanks! 

Suggest an answer

Log in or Sign up to answer