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 vote
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:

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published yesterday in Confluence

Think you know shares vs. @mentions in Confluence? Take this collab quiz.

To anyone who doubts that Atlassians are a little too obsessed with collaboration, and tools related thereto, let me describe a recent discussion we had (which took place on our internal Confluence, ...

108 views 2 4
Read article

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