Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to have the API recognize markup in the POST /rest/space request?

Emily Kern January 11, 2019

I'm trying to get lots of files that have Confluence markup onto a site. The markup does not copy/paste successfully, but putting it through insert --> markup works and allows the markup to properly display.

Since I have over 1,600 files to upload, is there a way to use the create space (POST /rest/space) request so that it knows to recognize the content as markup?

1 answer

1 vote
Tobias Anstett _K15t_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2019

Hi @Emily Kern,

If you want to script it using REST API, you could use

POST /rest/api/content?status=current&expand=body.storage

with the body set to:

{"type":"page","title":"Wikimarkup Page",
"space":{"key":"YOURSPACEKEY"},"body":{"storage":{"value":"*bold* -strikethrough-","representation":
"wiki"}}}'

doing so my example content *bold* -strikethrough- was transformed by Confluence to 

<p><strong>bold</strong> <span style=\"text-decoration: line-through;\">strikethrough</span></p>

in the page storage format in creation :)

Best, Tobias

Emily Kern January 14, 2019

Thank you for your response, but I am not sure if I understand. I am looking to use the Confluence markup, not any other markup. 

So I do not need new markup generated, I just need a way for whatever page or space I'm creating/importing to to recognize the Confluence markup so that content displays properly.

Unless, in the not unlikely event I completely misunderstood, using the storage format and perhaps retrieving it makes page/space recognize Confluence markup better?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events