I'm using the REST API to create a program that takes pages stored locally and uploads them into Confluence. I'm having issues if the page contains picture. So far, how I do it is: 1. create an empty page, and get the pageID. Then, make a post request to attach the picture to that page id. And thirdly, I'm updating the page with the layout I want (in xml). The last part fails, if I include the <ac:image> tag, returning a 500 internal error.
<ac:image ac:height="55"><ri:attachment ri:filename="image.png"/></ac:image>
That's the tag I'm using to upload the image. The request works without it and changes the page just fine.
Okay after checking the logs and doing some testing, I figured out the problem was I wasnt escaping the quotes correctly in the height and the filename. I was only escaping the quotes (as " -> \") but its also necessary to escape the backslash (so \" -> \\\"), in Java. Thank you a lot for the help and I hope my solution might solve the problem for anyone having the same issue.
Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events