Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×Hi,
I'm trying to use the Confluence Cloud API to update a page using the endpoint with an HTML body:
/wiki/api/v2/pages/{page_id}
So when I inject an image, I do it using the macro like this:
<ac:image ac:align="center" ac:thumbnail="true">
<ri:attachment ri:filename="my-picture.png"></ri:attachment>
</ac:image>
The picture has been uploaded previously with the endpoint :
/wiki/rest/api/content/{page_id}/child/attachment
It works fine, but the problem is that the image is not in "thumbnail" mode, is too big or can't be expanded if i use the width property to reduce the size :
If I try to edit it directly in the page, I get this message:
"This macro can’t be edited.
This macro was added to a page that was converted from the legacy editor.
It can’t be edited because it is now incompatible with the current editor."
Is there anything I can use instead of <ac:image>?
I just want to insert an image that can be expanded; otherwise, I’ll have to hardcode a width/height for each image in my code.
Can you try to convert the image to the new editor a second time? This is just a guess.
It seems i can't, this is what i see when i try to edit the page (even in "live doc" mode) :
And this is the error I see when I click the edit Image button.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can try to reverse engineer the new macro format:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, good idea — it worked! Here is the solution (width/height are optional):
<p />
<ac:image ac:align="center" ac:layout="center" ac:original-height="502" ac:original-width="917" ac:custom-width="true" ac:alt="sc.png" ac:width="768">
<ri:attachment ri:filename="sc.png" ri:version-at-save="2" />
</ac:image>
<p />
And this is the solution to use the inline mode
<p>
<ac:image ac:original-height="502" ac:original-width="917" ac:inline="true" ac:alt="sc.png">
<ri:attachment ri:filename="sc.png" ri:version-at-save="2" />
</ac:image>
</p>
Thank you Very much @marc -Collabello--Phase Locked- !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to Atlassian community!
I have created this support ticket https://getsupport.atlassian.com/browse/JST-1174476 to address this issue further, one of ur support agents will reach out to you shortly.
Best Regards,
Vishalakshi Narayanaswamy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.