I am creating documentation in Confluence through the REST API. I use a PUT action to update and entire page of content in Confluence with each transaction. How do I create working anchors and links in my HTML code which is then updated via the REST API?
I see how to manually add anchors by editing the page in Confluence. But I can't find documentation on automatically adding anchors via the API.
Any help would greatly appreciated. Thanks!
Hi @Al Wirtes
If you use a server, use markup to insert the anchor macro via API
If you are using Cloud
First, get the macro in storage format just to get an example of how the API should be formatted to include the same in the update page API
Then use the same format to update the page with anchor macro
Here is the API and ref
Thanks,
Pramodh
Thank you. But I'm sending full HTML and "representation" is sent to "storage". Markup will only work if I set "representation" to wiki, correct?
Is there any way to create anchors and links while also sending "representation": "storage"? Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perform the GET API and see how the data comes in storage format or you could also see it from the advanced details options. Sending the same format may work (It worked for me in cloud)
Give it a try and let me know 🙂
Thanks
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.