# Getting 503 error while calling confluence API

**URL:** <https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429>\
**Category:** Confluence Cloud\
**Tags:** template, oauth2, 3lo, rest-api\
**Created:** [June 30, 2021, 3:50pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429 "2021-06-30T15:50:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zluri](https://avatars.discourse-cdn.com/v4/letter/z/73ab20/32.png) [@Zluri](https://community.developer.atlassian.com/u/Zluri)\
**Post date:** [June 30, 2021, 3:50pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/1 "2021-06-30T15:50:28Z")

</div>

HI Team,

We are getting a 503 error while calling confluence API. Please see the attached screenshot for reference.

![Screenshot 2021-06-30 at 8.36.50 PM](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/b/4/b4fe2f820d6aeaa42449a921961dd8c5f9687f00.png)

The issue is similar to the issue described in this post: [https://community.atlassian.com/t5/Confluence-Cloud-questions/What-does-quot-503-Service-Unavailable-quot-mean/qaq-p/1734672](https://community.atlassian.com/t5/Confluence-Cloud-questions/What-does-quot-503-Service-Unavailable-quot-mean/qaq-p/1734672)

Can you please guide us what may be the root cause of this?

---

<div class="post-metadata">

**Author:** ![ibuchanan](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ibuchanan/32/35815_2.png) [@ibuchanan](https://community.developer.atlassian.com/u/ibuchanan)\
**Post date:** [June 30, 2021, 3:58pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/2 "2021-06-30T15:58:05Z")

</div>

@Zluri, welcome to the Atlassian developer community.

We really need [more context](https://community.developer.atlassian.com/t/how-to-ask-a-good-question/45777) to understand the problem. Could you provide context of the request you are trying to make? And with which authentication? Other information like which app framework (if any) or programming language (or tool) will likely help as we understand more.

---

<div class="post-metadata">

**Author:** ![Zluri](https://avatars.discourse-cdn.com/v4/letter/z/73ab20/32.png) [@Zluri](https://community.developer.atlassian.com/u/Zluri)\
**Post date:** [June 30, 2021, 5:15pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/3 "2021-06-30T17:15:05Z")

</div>

We have an OAuth 2.0 integration APP.

Once we are able to fetch access token ,we make call to [wiki/rest/api/templates/page](https://developer.atlassian.com/cloud/confluence/rest/api-group-template/#api-api-template-page-get) API.But its giving 503 Service Temporarily Unavailable error.

Check this screenshot for details.

 ![Screenshot 2021-06-30 at 11.00.03 PM](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/4/2/42da9536b37600c04ece6e04689bf809c46fc548.png)

This was working few days back.

We are able to generate access token and call [https://api.atlassian.com/oauth/token/accessible-resources](https://api.atlassian.com/oauth/token/accessible-resources) to get the url.  
But any confluence specific api always gives 503 error.

---

<div class="post-metadata">

**Author:** ![ibuchanan](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ibuchanan/32/35815_2.png) [@ibuchanan](https://community.developer.atlassian.com/u/ibuchanan)\
**Post date:** [June 30, 2021, 8:29pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/4 "2021-06-30T20:29:27Z")

</div>

@Zluri,

Looking at your request URL, it doesn’t fit the pattern described in the [3LO](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/#3-2-construct-the-request-url) documentation: `https://api.atlassian.com/ex/confluence/{cloudid}/{api}`

I can’t explain why the response has a 503 status with a result page that claims it is a 401. There’s a bug somewhere in there. But I can confirm that when you use the site-specific URL pattern (as works with API tokens but _doesn’t work with OAuth_), then you get that 401-hiding-inside-a-503 error. If it was working a few days back, it wasn’t with OAuth.

---

<div class="post-metadata">

**Author:** ![PatrickHofman](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@PatrickHofman](https://community.developer.atlassian.com/u/PatrickHofman)\
**Post date:** [July 1, 2021, 9:07am UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/5 "2021-07-01T09:07:26Z")

</div>

@ibuchanan That might be the problem we are experiencing as well. This worked for sure for a long time, and suddenly it doesn’t any more.  
Also, the URL in the Postman is correct according to the documentation at [https://developer.atlassian.com/cloud/confluence/rest/api-group-group/](https://developer.atlassian.com/cloud/confluence/rest/api-group-group/) (this links to ‘Groups’, which I am querying).

If there is another URL that we need to use, please document on this page as well (and all other related pages).

---

<div class="post-metadata">

**Author:** ![GuidoLeenders](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/guidoleenders/32/41366_2.png) [@GuidoLeenders](https://community.developer.atlassian.com/u/GuidoLeenders)\
**Post date:** [July 1, 2021, 9:11am UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/6 "2021-07-01T09:11:51Z")

</div>

Note that API URL like [https://acme.atlassian.net/wiki/rest/api/template/page](https://acme.atlassian.net/wiki/rest/api/template/page) works when opened in the browser after logging on to Confluence. Still HTTP 503 using previously working OAuth flow.

---

<div class="post-metadata">

**Author:** ![SheetalShetty](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@SheetalShetty](https://community.developer.atlassian.com/u/SheetalShetty)\
**Post date:** [July 6, 2021, 1:50pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/7 "2021-07-06T13:50:06Z")

</div>

@ibuchanan We are facing the same issue for groups, users, content searches using the confluence REST API.

All these endpoints worked seamlessly earlier, with the OAuth token and the org endpoint, but has stopped working now, giving the same error mentioned above.

---

<div class="post-metadata">

**Author:** ![ibuchanan](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ibuchanan/32/35815_2.png) [@ibuchanan](https://community.developer.atlassian.com/u/ibuchanan)\
**Post date:** [July 6, 2021, 2:06pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/8 "2021-07-06T14:06:47Z")

</div>

@PatrickHofman @GuidoLeenders @SheetalShetty

I can appreciate how frustrating it is when code that works, suddenly doesn’t. I certainly believe you that it used to work the way you wanted it. However, OAuth tokens weren’t meant to work with the same base URL as the UI and other REST API auth options. As I pointed out, the [3LO](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/#3-2-construct-the-request-url) documentation shows that you must use the common API proxy, not the base URL for the site. (Yes, I understand how confusing the REST API docs are on this matter, given they were written with older routing and auth mechanisms in mind.)

Although I have no doubt that something broke your code, I don’t know which change did that. And even if I knew the change, I can’t classify it as a defect or incident because it was unspecified behavior (at least according to engineering’s interpretation). Hence, all I can tell you is to use correct URL pattern:  
`https://api.atlassian.com/ex/confluence/{cloudid}/{api}`

---

<div class="post-metadata">

**Author:** ![SheetalShetty](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@SheetalShetty](https://community.developer.atlassian.com/u/SheetalShetty)\
**Post date:** [July 6, 2021, 2:15pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/9 "2021-07-06T14:15:57Z")

</div>

@ibuchanan Although the OAuth documentation mentions that we must use the common API proxy, this feature did not work when we were working the REST APIs earlier. I had also raised a support request([ticket](https://getsupport.atlassian.com/servicedesk/customer/portal/48/PCS-23862)) then, following which, we had to resort to the Org base URL instead(as it was the only way REST APIs were working) and pushed the changes to Production, hoping we would have the continued support for it.

---

<div class="post-metadata">

**Author:** ![PatrickHofman](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@PatrickHofman](https://community.developer.atlassian.com/u/PatrickHofman)\
**Post date:** [July 6, 2021, 2:19pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/10 "2021-07-06T14:19:46Z")

</div>

@ibuchanan We already updated our code to work with the assumed correct API url. However, as requested, please update the documentation accordingly. Not for us, but future developers debugging for hours.

---

<div class="post-metadata">

**Author:** ![CaterinaCurti](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/caterinacurti/32/42270_2.png) [@CaterinaCurti](https://community.developer.atlassian.com/u/CaterinaCurti)\
**Post date:** [July 8, 2021, 5:45am UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/11 "2021-07-08T05:45:02Z")

</div>

Hi @SheetalShetty,

I work with Ian and I will be helping out here from now on.

I have a question about your message, I saw the comment on the support ticket and the earlier community post and I wanted to confirm that the issue is the the one reporting in your comment here:

> [@6 new Group APIs and 2 Group API deprecations for Confluence Cloud](https://community.developer.atlassian.com/t/6-new-group-apis-and-2-group-api-deprecations-for-confluence-cloud/40358/6):
>
> Working on this further, I have found that the issue is not with the OAuth scope but the URL used for OAuth 2.0(3LO). Referring this document : [https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/](https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/) which says when using OAuth2.0(3LO), we need to construct the URLs in this format: [https://api.atlassian.com/ex/confluence/{cloud-id}/{api}](https://api.atlassian.com/ex/confluence/%7Bcloud-id%7D/%7Bapi%7D) but this format for the group-id APIs and user [APIs](https://developer.atlassian.com/cloud/confluence/rest/api-group-users/#api-group-users) gives 401: scope does not match error. On the other hand, changing the url to : [ht…](https://your-domain.atlassian.net/%7Bapi%7D)

Can you please let me know?

I’ll try to test it myself as well, but it might take me a few days so if you can confirm the exact problem, that’s going to help me a lot.

Thanks,  
Caterina

---

<div class="post-metadata">

**Author:** ![CaterinaCurti](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/caterinacurti/32/42270_2.png) [@CaterinaCurti](https://community.developer.atlassian.com/u/CaterinaCurti)\
**Post date:** [July 8, 2021, 5:46am UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/12 "2021-07-08T05:46:52Z")

</div>

Hello @PatrickHofman,

Let me bring this up with the relevant teams and make sure that the documentation update is on their radar.

Thank you for letting us know that the code has been updated now. If anything unusual comes up, please let me know by commenting here (also feel free to mention me directly) and I’ll look into that right away.

Thanks,  
Caterina

---

<div class="post-metadata">

**Author:** ![SheetalShetty1](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@SheetalShetty1](https://community.developer.atlassian.com/u/SheetalShetty1)\
**Post date:** [July 8, 2021, 1:21pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/13 "2021-07-08T13:21:40Z")

</div>

@CaterinaCurti Yes, that’s right. And this was the case for all Confluence Cloud APIs.

---

<div class="post-metadata">

**Author:** ![CaterinaCurti](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/caterinacurti/32/42270_2.png) [@CaterinaCurti](https://community.developer.atlassian.com/u/CaterinaCurti)\
**Post date:** [July 9, 2021, 4:30am UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/14 "2021-07-09T04:30:01Z")

</div>

Hi all,

Let me try to add some clarity and context to this thread.

**What changed?**  
The affected APIs were not intended to be working when using the site URL, this incorrect behaviour has been addressed and that’s why they are now returning a `401` status code.  
The way forward is to always use the [api.atlassian.com](http://api.atlassian.com) format when accessing the affected API endpoints.

This is documented for “OAuth 2.0 (3LO) apps” on the [https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) page.

We understand that this should have been communicated beforehand and we will do better in the future. This topic has been brought up with all the parties involved and we will improve our processes to make sure that the right communication with the right notice is provided.

**Why `503`?**  
While deploying the change, for a limited amount of time, when using the site URL format, the APIs have been returning a `503`. This wasn’t intended and all affected APIs have been updated to return `401` as status code.

**What about the incorrect documentation?**  
A few documentation pages are still mentioning the site URL format in the examples, this will be addressed as part of the [[CONFCLOUD-72411] Documentation pages incorrectly suggest to use the "your-domain.atlassian.net" instead of the "api.atlassian.net" one - Create and track feature requests for Atlassian products.](https://jira.atlassian.com/browse/CONFCLOUD-72411) bug report.  
If any other pages, that are not mentioned on the bug report, are also affected, please add a comment to the CONFCLOUD-72411 directly.

I hope I covered all the concerns expressed in this thread with this reply. If not, please let me know and I’ll get back to you.

Thank you,  
Caterina

---

<div class="post-metadata">

**Author:** ![SheetalShetty1](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@SheetalShetty1](https://community.developer.atlassian.com/u/SheetalShetty1)\
**Post date:** [July 9, 2021, 4:37am UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/15 "2021-07-09T04:37:01Z")

</div>

Hi @CaterinaCurti  
Just to confirm, has the Base URL also changed from [api.atlassian.com](http://api.atlassian.com) to [api.atlassian.net](http://api.atlassian.net) ?

Thanks,  
Sheetal

---

<div class="post-metadata">

**Author:** ![CaterinaCurti](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/caterinacurti/32/42270_2.png) [@CaterinaCurti](https://community.developer.atlassian.com/u/CaterinaCurti)\
**Post date:** [July 9, 2021, 4:37am UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/16 "2021-07-09T04:37:48Z")

</div>

My bad @SheetalShetty1 , no changes there.

Let me fix my comment above.

_Update_: fixed now.

---

<div class="post-metadata">

**Author:** ![CaterinaCurti](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/caterinacurti/32/42270_2.png) [@CaterinaCurti](https://community.developer.atlassian.com/u/CaterinaCurti)\
**Post date:** [July 9, 2021, 4:45am UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/17 "2021-07-09T04:45:59Z")

</div>

Hi @SheetalShetty1,

Let me answer your comment here directly, while I’ve addressed the broader topic here: [Getting 503 error while calling confluence API - #14 by ccurti](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/14).

When using the `https://api.atlassian.com/ex/confluence/{cloud-id}/{api}` API, if the returned http status code is `401` the problem is most likely with the app not having the correct scopes set and therefore. To prevent that, please make sure that the correct scopes are specified when requesting the authorization code.

If you think something else is happening, let’s keep the conversation going in the original thread.

I’ll cross-post my reply there as well.

Thanks,  
Caterina

---

<div class="post-metadata">

**Author:** ![PrzemysawKanach](https://avatars.discourse-cdn.com/v4/letter/p/87869e/32.png) [@PrzemysawKanach](https://community.developer.atlassian.com/u/PrzemysawKanach)\
**Post date:** [July 12, 2021, 12:53pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/18 "2021-07-12T12:53:18Z")

</div>

Hello,

I recently created the topic about related problem here: [Downloading attachments content using OAuth2 from the Confluence - #5 by PrzemysawKanach](https://community.developer.atlassian.com/t/downloading-attachments-content-using-oauth2-from-the-confluence/49572/5) but this place seems to be fine to address it.

So the breaking changes described here made that downloading attachments’ content is no longer possible using `download_link` because it doesn’t work with the OAuth token.

Are there any plans to fix the issue or you have any advice how to download attachments content using OAuth token?

The code which doesn’t work any more:

```bash
curl --location --request GET '<MY_INSTANCE>/rest/api/download/attachments/<ATTACHMENT_ID>/sample.pdf?version=1&modificationDate=1615204617358&cacheVersion=1&api=v2' \
--header 'Authorization: Bearer TOKEN'

```

Thank you in advance,  
Cheers

---

<div class="post-metadata">

**Author:** ![RandySwift](https://avatars.discourse-cdn.com/v4/letter/r/34f0e0/32.png) [@RandySwift](https://community.developer.atlassian.com/u/RandySwift)\
**Post date:** [July 12, 2021, 6:43pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/19 "2021-07-12T18:43:40Z")

</div>

This is also a gap for us - we’ve been relying on the ability to download attachment binary content via the download link for years with an OAuth 2 token.

---

<div class="post-metadata">

**Author:** ![RandySwift](https://avatars.discourse-cdn.com/v4/letter/r/34f0e0/32.png) [@RandySwift](https://community.developer.atlassian.com/u/RandySwift)\
**Post date:** [July 12, 2021, 7:14pm UTC](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429/20 "2021-07-12T19:14:24Z")

</div>

> [@CaterinaCurti](#):
>
> We understand that this should have been communicated beforehand and we will do better in the future. This topic has been brought up with all the parties involved and we will improve our processes to make sure that the right communication with the right notice is provided.

Would it be possible to re-enable this functionality, with an announced EOL? This change has effectively broken what was previously documented expected behavior. It may not be documented _now_, but it was previously, and [https://jira.atlassian.com/browse/CONFCLOUD-72411](https://jira.atlassian.com/browse/CONFCLOUD-72411) shows that there are still areas where this is documented as supported behavior. This kind of backwards-incompatible change, with no warning, really leaves your customers and integration partners up a creek.

[Next page](https://community.developer.atlassian.com/t/getting-503-error-while-calling-confluence-api/49429.md?page=2)
