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

Empty page when editing the page after using PUT /rest/api/content/{contentId}

G.M. K. January 9, 2019

I'm using Confluence 6.13 Server (on premise, Windows 2012R2 + SQL Server).

I have created a new page "REST-Test-2019" and added some content. After that I updated the page contents using the REST API

PUT /rest/api/content/{contentId}

The JSON payload is

{"version": {"number": 2}, "title": "REST-Test-2019", "type": "page", "body": { "storage": { "value": "<p>My new content</p>", "representation": "storage" }}}

The exact URI is

http://myconfluenceinstance/rest/api/content/28737562?status=current

I get a response status code of 200 which means 'OK'.

After updating the page via REST API the page displays the new content correctly. However, if I start editing the page via webbrowser UI, I get a blank page - no content at all. The only method to restore the new page content is to click on the three dots at the bottom of the page and choosing the menu item 'Reset to last published version'. If I confirm the warning message I get the content which I set through the REST API call.

Any ideas?

Thanks,
Guido

2 answers

1 accepted

1 vote
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 10, 2019

Hello Guido and welcome to the Community!

You have a very solid understanding of the Confluence API and how to update pages. Your JSON payload is good and will update the page. There is a possible issue with your URL that is being used. When you make a call to a stated URL, for this example:

http://myconfluenceinstance/rest/api/content/28737562

The result will be the page is updated with the content and the draft is published.

However, when you make a call with this URL for example:

http://myconfluenceinstance/rest/api/content/28737562?status=current

Your content is not published and created in draft status. You will also notice using this URL will have the page display “unpublished changes” next to the breadcrumb menu.

I was unable to reproduce your edit page after REST API PUT issue you explained. Something I would like you to consider testing would be to use a different URL when updating Confluence. Can you please try a URL without the “?status=current” and let us know the results?

We look forward to your reply so we may resolve this issue together.

Regards,
Stephen Sifers

G.M. K. January 14, 2019

Hello Stephen,

I tested your suggested URL and still get an empty page when switching to "Edit" mode.

I've taken some screen shots from the database tables CONTENT and BODYCONTENT.

CONTENT table with newly created REST-Test-2019 page:

CONTENT_1.png

 

BODYCONTENT table:

BODYCONTENT_1.png

 

After updating with URL http://myconfluenceinstance/rest/api/content/31588378 with JSON payload from above:

CONTENT_2.png

BODYCONTENT_2.png

Do I also have to update the draft? The REST API documentation says: Updating a draft is not currently supported

Thanks for your ideas,
Guido

Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 14, 2019

Hello again Guido,

We need to figure out why you're receiving a blank page when editing then. While it is coincidence, it may not be directly related to your API calls themselves. Please review and answer the following so we can work our way through this issue:

  1. Can anyone edit the pages you've created?
  2. Have you attempted a hard refresh in the browser to edit the page?
    1. CTRL/Control + F5
  3. Which browsers have you tried when editing the page?
  4. Can you let us know of any findings in: Log Scanner and Scheduled Log Scanner

This should help us find where your blank edit issue is coming from. We look forward to hearing back so we may find a resolution to this issue.

Regards,
Stephen Sifers

G.M. K. January 14, 2019

Thanks for your efforts. The problem did not go away by using different browsers/user accounts or by clearing the cache. Finally, I switched into 'safe mode' to deactivate all plugins - and it worked. By manually deactivating all plugins and then reactivating one by one I found a 'K15t Scroll platform' plugin that caused the trouble. Since we currently don't need it, I deinstalled the plugin and now everything works.

Thanks again,
Guido

Like Stephen Sifers likes this
0 votes
WW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2019

Of course I saw this question after I posted mine. :) (https://community.atlassian.com/t5/Confluence-questions/Anyone-Else-s-Edit-Version-Differ-after-Updating-Confluence-page/qaq-p/984379)

But I think we're having a similar problem.  I wonder if yours is also reverting to an older version in edit view (the very first version, or some other version when the page was blank).  As you'll see in my post, it tends to revert to the same older version.  I don't know if something happened with that version or what that makes it revert to that one.

In my case, the pages were created with the API as well as updated.  I wonder if I manually created a page, then updated it with the API, if the edit view would be blank? 

I'll need to check to see if we have the 'K15t Scroll platform' and if I can deactivate it, too.

roman
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2019

Hi @WW,

Scroll Platform is bundled with these apps: Scroll Versions, Scroll Translations and Scroll Acrolinx Connector. If you still have any of these installed, don’t remove the Platform. Otherwise, these apps will be disabled and stop working.

If you don’t have any of the mentioned above apps in the UPM, it is recommended to also remove Scroll Platform.

Hope this information helps to know where Platform comes from.

Roman.

Like WW likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events