Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

creating confluence pages programmatically

Petr Zhura March 2, 2018

I need to create a large amount of confluence pages, which describe an api (dozens of services and hundreds of pages). Trying to do this by hand makes me crazy. 

I want to implement a script which would do it for automatically. The script would fetch a domain model for services, create appropriate markup and post it using confluence rest api.

As far as I understood, confluence uses custom markup for page content. Certainly, I could create a template for each element like paragraph or table und render markup based on my teamplates. But instead I would rather like to use an Java api for its creation.

Does something similar exist?

1 answer

0 votes
James Richards
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 12, 2018

Hi Petr,

 

Using a Java  for this would probably be way too much for what you're trying to achieve.

There are 2 ways you can do this, one would be to use a template, where you can have fields that populate the data or create pages with a REST call.

For creating a template, you'd follow the steps here

And for creating pages with a REST call, which I think would be better for you since it sounds like you have complex pages with content that already exists somewhere, try this document as a start

Remember you need to use the XHTML markup to create the pages. So, I'd suggest creating an example page and then go to ... > View Storage Format to see what it looks like, and then use that to create the page you want with the REST call.

Hope this helps.

Thanks, James

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events