I have been able to create a confluence page using confluence rest APIs. All good so far.
My questions are as follows:
1) Is it possible to add my own custom stylesheet via the rest API so to style the html I send?
2) When sending my html could I set the class attribute to a certain value so that the confluence server would know to interpret this to be tabbed page content on that page?
3) Is there an sample code that is achieving my objective above?
Thanks in advance as to any help regarding the above.
When you are using the REST api to create content, you are not sending HTML, but sending confluence storage format. It acts like HTML, but it is not, and you will not be able to directly send any style sheet tags either.
You need to find and install a plugin containing a macro that displays tabbed content, and send storage format that correspond to that macro in your REST api call. You can find out what the storage format looks like for the tabbed content macro by installing the source editor plugin (https://marketplace.atlassian.com/plugins/com.atlassian.confluence.plugins.editor.confluence-source-editor) and manually creating the page in the editor, then view the source.
If you really want to send HTML directly, and style it with a style tag, you can use the "html" macro (see docs here https://confluence.atlassian.com/doc/html-macro-38273085.html). This is a dangerous macro to enable, as it is basically an open XSS vulnerability - anyone who has edit permission to the page can add any HTML.
Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events