Hi all,
I'm facing problems with updating Confluence pages via API and can't figure out what the underlying issue is. I hope to find some help here 😊
What am I trying to achieve?
I want to pull two reports and update certain Confluence pages with this data on a daily basis. One is an overview of all user- and group permissions of all of our spaces (Confluence Cloud Enterprise), the other is an overview of all admin users of all of our spaces.
How am I trying to achieve this?
I developed a phython script (ok, let's be honest: I asked chatGPT to create a phython script 😂), which fetches all spaces and all permissions of these spaces, then generates the overview tables and finally updates the given pages with these tables.
What problem am I facing?
When I fetch up to 20 spaces, everything is fine, the script is doing what it's supposed to, the pages are updated as expected.
But when I fetch 30 or more spaces (I didn't test from which exact count between 20 and 30 the issue starts to occur), then the API endpoint to update the page returns following error code and message:
Failed to update page 733020532: 400, {"errors":[{"status":400,"code":"INVALID_REQUEST_PARAMETER","title":"Content body cannot be converted to new editor format","detail":null}]}What's really strange (at least to me), is that the issue is not about fetching the spaces, this works fine for our ~200 spaces (I let the script print them for debugging reasons).
(Although I know that all permission tables for 200+ spaces are quite a lot, I'm sure that it does not necessarily exceed any page size limit: in a very early version of this script I already managed to update the page with all these tables. I just lost this version somehow, probably when I tried to redesign it 😣)
The target pages are in the new editor format, this isn't touched anywhere in the script.
Please find the relevant functions as follows (I don't find any way to post the code here in a proper way, so I just made screenshots of it):



If you need further information or script details, just let me know.
I'd be very happy for any hint you guys can give me!
Best regards,
Stefan