Forums

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

What is the API to get subdomain or base url of confluence?

Anuja Deshpande
Contributor
January 25, 2020

How to get subdomain using API, as accessible resource API isnt working

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Veera
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 25, 2020

@Anuja Deshpande 

When you subscribe for Confluence Cloud version, you can choose your domain name so that your Cloud site will be created as with that domain name. 

Let's say if you choose, anuja as your domain, your Cloud site will be created with URL: https://anuja.atlassian.net.

Your Cloud URL is the base URL you need to use in the REST API calls. So, in this case https://anuja.atlassian.net becomes Base URL for your REST API calls.

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2020

What do you mean by "subdomain"?

Also, if you want to get something from the API, you need to ask for it by the base url.  If you don't know the base url of a Confluence already, you don't know where it is, so you can't ask.  Whatever confluence you're trying to talk to, you already have the base url.

Anuja Deshpande
Contributor
January 25, 2020

@Nic Brough -Adaptavist- 

Consider following example,

curl --request GET \ --url 'https://your-domain.atlassian.net/wiki/rest/api/audit' \ --header 'Accept: application/json'

 

I am referring to your-domain.atlassian.net, Is there an API which returns domains for current user. 

It is mentioned in https://developer.atlassian.com/cloud/jira/platform/oauth-2-authorization-code-grants-3lo-for-apps/

that, accessible resource API does not return base url. so what is the alternative to that API?

Like # people like this
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 26, 2020

To issue your example call, you have used the base url already.  So you know it.  It is   'https://your-domain.atlassian.net/wiki . 

As for the wider question, what you're really asking is "what services does a particular Atlassian account have access to?".  There is no API on Atlassian's services for that because it's illegal for you to get that information.

Like Veera likes this
TAGS
AUG Leaders

Atlassian Community Events