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

This widget could not be displayed.
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

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

495 views 7 6
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