Hi.
I am looking into how I can identify a Confluence Page/Content from it's URL.
On the self-hosted server, the page has a reference to the pageid:
<!DOCTYPE html>
<html>
<head>
...
<meta name="ajs-page-id" content="845153134">
But on the cloud-hosted server, I only get that after the JS/ajax was executed.
How can I identify the page on a cloud server with curl?
Thanks for the help
Hey Oliver, I might misunderstood what you're aiming for but if you want to get the contentid using curl with the title of the page for example you can use the content REST API endpoint.More information here https://developer.atlassian.com/cloud/confluence/rest/#api-content-get
For e.g if the title of the content is "Meeting Notes" you can use curl GET to the following endpoint to get the content id
https://<instance>.atlassian.net/wiki/rest/api/latest/content?title=Meeting%20notes
Hi.
Imagine you have a short URL: https://xxx.atlassian.net/wiki/x/YIkAB.
I want to use https://developer.atlassian.com/cloud/confluence/rest/#api-content-id-get to get the content of the page: https://xxx.atlassian.net/wiki/rest/api/content/{contentId}.
My question is: how can I find the contentId of the page without knowing the title or space?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I dont think its possible to get it directly from the existing endpoints. Though i can see that the short URL is returned in the json output so its possible to parse the results using jq to get a list of content id with the matching tinyurl for all content (there's a 500 results limit in the cloud if i remember correctly) with the following command
curl --silent --user <user>:<token> -X GET "https://<instance>.atlassian.net/wiki/rest/api/content?type=page&expand=property" | jq ".results[] | [{ id: .id, tinyurl: ._links.tinyui }]"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
walking through all pages on the server is definitely not an option.
Every page as a meta tag which contains the ID of the page:
<meta name="ajs-page-id" content="845153134">
The problem is that the cloud server only adds this tag through JS.
So I have working code for the On-Premise server and am looking on how I can get it to work for Cloud server as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you say you had the code working for On-Premise server ? Can you share it with us? I'm interested in getting the page ID from REST API knowing only the page url which may by a tiny url only
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.