How to save a code block to confluence through jsonrpc api?

I tried to save a code block ({code}somecode here{code}) using the api. It saved the plaintext to confluence, not a code block. How can I save a code block? A sample will be much appreciated.

btw, the confluence version is 5.4.4

1 answer

0 votes
Stephen Deutsch Community Champion Sep 29, 2015

You'll need to use the Storage format instead of wiki format.  Examples can be found in the official documentation here: https://confluence.atlassian.com/doc/code-block-macro-139390.html#CodeBlockMacro-Storageformatexample

You would probably end up using the 1st or 2nd example from the table, I would imagine.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

94 views 3 4
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you