Hi community,
I was wondering on how I can efficiently get the header image of a blogpost. I know I can use the 'https://{your-domain}/wiki/api/v2/blogposts/{id}/attachments' call to get all the attachments of a blogposts, including the header image if it exists. However, it will also give me all the other images that have been used within the blogpost. The issue is, I'm not sure on how I can distinguish the header image out of all the images I retrieve out of that call. I don't see a way to add an additional query to the call, or distinguish it based on the result I get back.
Any help would be appreciated.
Community moderators have prevented the ability to post new answers.
Welcome to the Atlassian community!
I wouldn't rely solely on the attachments endpoint, as the v2 API doesn't indicate which attachments are header/cover images; all look the same regardless of type.
One reliable approach is to fetch the blog post body in Atlassian Document Format (https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/) and inspect it directly like: GET /wiki/api/v2/blogposts/{id}?body-format=atlas_doc_format The cover image in Confluence Cloud is represented in the ADF body as a mediaSingle node that sits at the very top of the content array.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.