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

Frank Dai September 29, 2015

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
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.
September 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
TAGS
AUG Leaders

Atlassian Community Events