Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Import a Word document using REST API


In the end of a batch I need to upload a resultant MS Word document as a page in Confluence using programmatic way as REST API.

In the web portal the tool that works for me is Import Word Document from the link below but I don't see how it can be programmatically called.

Any other tools are welcome,

Thank you

2 answers

Is this link is not working for you?

It is the same from my initial post and as I mentioned it works not the way I need to access it. It works perfect with a mouse and a web browser but I need to trigger it in command line from a web app server.

Looks like someone found a solution here possibly! Possible solution 

It is a possible solution but has two disadvantages which makes it not acceptable to me:

1.  It produces not a native Confluence (HTML) page - The viewword macro just embed an iframe preview and the editing of the page is possible only with spacial add-ins.

2. Using Webdav suppose to mount permanently the 'file system' of the Confluence on my web app server which is generally not a good idea. 

@Georgi Yankov , I'm also in search of a solution importing Word files via REST api. Can you share what was your solution?

I am not Georgi but I'd still like to share my solution: I converted all word files to txt-files using pandoc ( like so:

pandoc $file -f docx -t jira -s -o $file.Replace(".docx", ".txt")

Then, I imported these txt-files using the Atlassian Command Line Interface (see Marketplace) like so:

acli prod --action storePage --file $fileName --space $spaceKey --title $title --parent "My Parent Page"

This I did for hundrets of files using a powershell script. The results where pretty decent for well-formated Word-files.

Like Peter-I likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence Cloud

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

26,008 views 21 100
Read article

Community Events

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

Events near you