I want to check via REST API if an attachment is used in other pages.
/rest/api/search?cql=siteSearch~'Hydrangeas.jpg' & includeArchivedSpaces=true & type IN (blogpost, page)
works for the file name "Hydrangeas.jpg" of the attachment. But that file name might be another attachment with the identical name on another page.
But regarding the "data-image-src" attribute of an embedded image (f.e. "/context/download/attachments/104956981/Hydrangeas.jpg?version=1&modificationDate=1563972519812&api=v2") I can't use this.
F.e. this will not work:
https://<removed>/rest/api/search?cql=siteSearch~104956981&includeArchivedSpaces=true&type IN (blogpost, page)
Hello Stefan,
I’ve reviewed your notes and followed the steps you took along with completing a GET call on a page to get attachments. What I found was the file is always referred to as the filename of the attachment per the parent page it’s attached to. The ID you refer to seems to be the parent page the attachment is associated with. With this said, you’ll need to use the filename and the parent page to locate a file to avoid any attachments with similar names.
If I’ve missed something within your steps, please do let me know and I’ll recheck. I would be interested to know where you’re getting the ID to search for the attachment from.
Regards,
Stephen Sifers
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.