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

Is there a way to import a XML file as a Confluence Pace using RESt API Call or CLI

Santanu Roy April 19, 2021

Using JIRA - Data Center Version.

I have a simple XML file with below three headers along with its corresponding content

 

User Story Name :XXXXXX

Description : YYYYYYYY

Acceptance Criteria : ZZZZZZZZ

 

Is it possible to import this .xml file onto a Confluence Page using the REST API Call.

 

1 answer

0 votes
Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 20, 2021

Dear @Santanu Roy ,

sure it is. I assume that you would like to display the 3 headers like panels or other structured elements on  a page.

All you need is the documentation to the REST API and a browser extension to test your rest calls.

The way how to do:

  • create a page like the XML data should be displayed - a sample page
  • read this page with the rest call GET /rest/api/content
  • Whats returned is JSON. Now you know how it is strucured.
  • Replace the content in this JSON with the data from your XML
  • POST /rest/api/content will create a new page with your modified JSON

You will find some samples here. I recommend to use a script language like Python or PHP to write some simple code to repeat the REST calls in an easy way without the browser extension.

So long

Thomas

Note: If you just want to upload the XML as an attachment to an existing page, serach for this at the samples.

Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 5, 2021

Dear @Santanu Roy ,

was my answer useful? Then I would be happy when you click on the "green accept answer" button.

So long
Thomas

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events