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