Creating a page with REST API works; updating the page gives an error

I’m writing some code to create and maintain some pages on Confluence programmatically.

Creating the page is working. However, when the code wants to update that page, I’m getting an error 500 back from Confluence because exceptions are occurring in the processing of my data.

com.atlassian.confluence.content.redner.xhtml.XhtmlParsingException: The XML content could not be parsed. There is a problem at line 1, column 86. Parser message: Undeclared namespace prefix “ac”

I’ve following the steps in to use curl to do the same steps manually and I’m getting the same error. If I just change the method from PUT to POST, remove the page ID and change the page title, i.e. creating a page instead of updating the page, it works so the content itself doesn’t appear to be bad.

Has anyone successfully used the REST API to update an existing page that uses more complex content than just HTML?

It looks like it is a bug in the version of Confluence we’re using (6.0.3). I’ve just set up a test/scratch server of 6.2.3 and the page update works fine.

Time to schedule maintenance on our server :slight_smile:

1 Like