Hi Everyone,
I would appreciate it if someone would help me determine how to add links to external resources via the API.
ie.
... storage:{"value":"New content -- [Atlassian|http://atlassian.com]"} ...
Will just update/create a page with the bracketed string printed rather than creating an embedded link.
Thanks in advance,
John
Hey John,
The actual format of the text to post is Confluence's internal Storage Format. The easiest way to check the correct syntax of a page is save a page in Confluence and then click on the top right "..." and click "View Storage Format". This is the text that would need to be posted via the REST API.
Here's an example!
My Confluence page:
And here's the raw JSON I am posting to:
URL:
{
"type":"page",
"title":"Test page from REST API",
"body":{ "storage":{"value":
"<p>Link to <a href=\"https://community.atlassian.com\">Atlassian Community</a></p><p><br /></p><p><ac:link><ri:page ri:content-title=\"Test page\" /></ac:link></p>",
"representation":"storage"}},
"space":{"key":"PD"}
}
(remember to escape the quotes)
I've provided two linking methods in the above example:
Cheers,
Eric
Eric, do you have an idea how to get page's content through API ( i.e. content of "Value") in human readable format, I mean with line breaks as it looks if you open "View Storage Format" or open "Source editor" in Edit mode?
"View Storage Format"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Eric,
I am currently looking for similar requirement of getting clickable links using json restful table. It would be helpful if u can suggest if you found a way for the problem
Cheers,
Kishore
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eric,
I have the same question as Kishore. Is there a way to get clickable links into the table as content? I have tried a few iterations, but I keep getting just HTML syntax showing inside the cell
(such as: <a href=https://myapp.mydomain.com>https://myapp.mydomain.com</a>)
Thanks
Venkatesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.