SOAP and REST APIs

Hi All,

 

As part of our automated process of continuous delivery, we would like to generate documentation for our product and publish it to confluence. I'm want to use a maven plugin, so this part of the process can be easily called by any team member or jenkins build. This is the plugin (see https://github.com/bsorrentino/maven-confluence-plugin ) This plugin is great for a java project, to keep documentation in sync with code. That can be a great tool for us and tech pub, our customer etc.
This use an API of confluence, xml rpc, that is deprecated for confluence 5.5 (see https://developer.atlassian.com/confdev/confluence-rest-api/confluence-xml-rpc-and-soap-apis ) Quoting this page : The XML-RPC and SOAP APIs are deprecated since Confluence 5.5.

So first question, is this API available in our confluence server ?


 I tried using the REST API https://developer.atlassian.com/confdev/confluence-rest-api but I can only have successful read, no write. I was not able to create a document using my own user account/password in this API.
So second question, is there something preventing me to have write access through REST API ?
Do you see a solution to my problem of being able to automatically create document in confluence ? Maybe there is another way that you already know, or maybe this isn't allowed.

 

Thanks for taking a look!

1 answer

The SOAP APIs are deprecated, but still available and will remain so until equivalent REST APIs are in place. There are quite a few SOAP capabilities missing. If there is a REST API available for the function you want, best to use that, otherwise use the SOAP APIs. If you are just creating pages, the REST APIs should be sufficient. 

The Confluence Command Line Interface (CLI) is an alternative for this type of use case. It uses a combination of  REST or SOAP APIs to provide various actions - see Reference. Moreover, if you are a Bamboo user (I know you referenced Jenkins), it is even easier to integrate using the Confluence CLI task. For Jenkins, you would need to install the client on your Jenkins server and just use command scripting.

Hi Bob,

Thanks for your answer!

 

Could you please comment this statement?:

===========================================

So you are telling me that the xml rpc API, besides being deprecated, is still available ? If this is correct, then the maven plugin I'm using should succeed. This plugin can't use Confluence Command Line Interface nor Confluence REST API. So if the xml rpc api is available for us, it should do the trick.
This morning, 9H47 am my time (France) I tried to create page and I got the following :    [INFO] Confluence version [5.5.4-5517] development version [false] [ERROR] has been imposssible connect to confluence due exception org.codehaus.swizzle.confluence.ConfluenceException: java.lang.Exception: com.atlassian.confluence.rpc.RemoteException: You're not allowed to view that page, or it does not exist.
The credentials I'm providing are mine (username and my password) and seems correct because I have a different error when using another password or login.


 Can you tell me why this was not allowed ?

===========================================

Oleg

Yes, they are available (provided they are enabled - https://confluence.atlassian.com/doc/enabling-the-remote-api-150460.html) and your error message indicates that you are connecting and just getting an error message: You're not allowed to view that page, or it does not exist.

You will need to sort that part out on your own.

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
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,695 views 26 10
Join discussion

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