Retrieve the header image of a blog post with the V2 Rest API

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.

@MartijnMuskens from the V1 search API at least, I expand metadata.properties.cover_picture_id_published and then determine if the header is an attachment or an external image from unsplash. You can still use the search API to get a single blogpost.

1 Like