Whether Confluence Server can be accessed by using the Confluence Cloud API Endpoints?
Asked by Gajapriya Masilamani:

I explain my question with one example.

To get the user information from the confluence, we can use this API Endpoint

https://{sitename}.atlassian.net/wiki/rest/api/user?accountId={accountId} in Confluence Cloud.

But the same API Endpoint can't be used in the Confluence Server(on-premise)since it doesn't support any query parameter like accountId. And also the responses from these 2 API Endpoints are differed in their node (JSON Response) structure.

I have also mentioned the reference link: <https://docs.atlassian.com/ConfluenceServer/rest/7.1.0/#api/user-getUser>

So, my final conclusion is that Confluence cloud and On-premise server have different API Endpoints for retrieving the contents.

Whether it is correct or not?

Kindly share your thoughts on this and if my understanding is wrong, kindly correct the same


Answers:
author: Shannon S
body: Hello [@Gajapriya Masilamani](/t5/user/viewprofilepage/user-id/3251952),

Nice to hear from you again! That is true, Confluence Cloud and Server have different API endpoints. They are developed separately, and so if you want to make a call on Server that you have on Cloud and vice-versa, you'll want to check to make sure that the endpoint exists for both.

The documentation you found is correct for Server, and you can compare it to [Confluence Cloud REST](https://developer.atlassian.com/cloud/confluence/rest/) documentation.

Regards,

Shannon

comments: author: Gajapriya Masilamani
body: Hi Shannon,

Thank You for your response.We will check the API Documentation of Confluence Server and Cloud based on our needs and will use the same.

Regards,

Gajapriya.


author: Gajapriya Masilamani
body: Hi Shannon,

I have one more doubt regarding the Confluence Cloud and Server APIs.

Whether the responses given by the APIs are differ in their node structure.

For example,

To get the content with the id 1234, **/rest/api/content/1234** Endpoint is used in both the Confluence Server and Cloud.

But, the responses given by the Confluence Server and Cloud are different(i.e)some nodes are missed and order of nodes changed in response (JSON Response) . I checked this with the sample response for Server since we are not configured any On-prem server yet.

So, my final conclusion is that responses given by both the APIs are differ in their node structure ( JSON Response ).

Kindly share your thoughts on the same.

Thank You.


author: Shannon S
body: Hello [@Gajapriya Masilamani](/t5/user/viewprofilepage/user-id/3251952),

As I mentioned previously, the API for Confluence Server and Cloud are completely different and developed separately. There are some cases where you might find they are similar across Server and Cloud, but this isn't the norm. You will need to check the API documentation for each.

* [Confluence Server REST-API Documentation](https://docs.atlassian.com/ConfluenceServer/rest/7.1.0/)
* [Confluence Cloud REST-API Documentation](https://developer.atlassian.com/cloud/confluence/rest/?_ga=2.27264828.1400638574.1573472123-1642555208.1571221417)

For example, with the example you provided in your question. In our Cloud products (Jira, Confluence, and Bitbucket Cloud), [we deprecated usernames](https://developer.atlassian.com/cloud/jira/platform/api-changes-for-user-privacy-announcement/) and thus you need to reference users with their account ID, whereas in Server, you can refer to usernames still in your API calls.

Let me know if you have any questions about that.

Regards,

Shannon


author: Gajapriya Masilamani
body: Hi Shannon,

Thank You for your response.Now I understood it clearly.

Regards,

Gajapriya.


author: Shannon S
body: You're welcome, Gajapriya!

Take care, and have a pleasant rest of your week.

Regards,

Shannon


Tags: cloud

confluence-cloud