How about using the get content by id REST API? Example frontend JS:
var pageId = '12345';
var url = AJS.contextPath() + '/rest/api/content/' + pageId;
var links = response._links;
var pageUrl = links.base + links.context + links.webui;
var pageTitle = response.title;
Theoretically you don't even need to build the URL from the response object. You could just append the pageId to "/pages/viewpage.action?pageId=" to get the link.
The Confluence Cloud API documentation has details about the GET content method, along with some code snippets for Node, Python, and PHP.. and curl.
Hey there! New in town? Check out the new Confluence product guides! They are chock-full of helpful tips, tricks, and best practices to get you and your team started. Here’s a quick overview...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event