Forum Discussion

Inactive User's avatar
Inactive User
Not applicable
6 years ago
Solved

Get cover image using API V1?

Is there a way to select the cover image using API v1?

There's the images array, and I can obviously select the [0] image -- if the cover image is the first one. What if it's not?

https://devdocportal.lithium.com/t5/Community-API-v1-Reference/bd-p/restv1docs?section=commv1&leaf-id=Message.images#Message.images

5 Replies

  • Inactive User, Its difficult to use that using V1, since V1 treat cover image and body images in same API. Also there is no difference in there node.

    I would suggest its better to use API V2 in this case, to get specific cover image of messages using API below.

     

    SELECT cover_image FROM messages WHERE id='2366'

     

  • Inactive User's avatar
    Inactive User
    Not applicable
    6 years ago

    Parshant Thank you, however I need to use v1 for this particular project. Is it impossible or just difficult? 

  • Parshant's avatar
    Parshant
    Boss
    6 years ago

    Its seems to be impossible, since it doesn't make any differences in node or attributes with other images in array. 

  • Inactive User's avatar
    Inactive User
    Not applicable
    6 years ago

    Parshant wrote:

    mcdvoice, Its difficult to use that using V1, since V1 treat cover image and body images in same API. Also there is no difference in there node.

    I would suggest its better to use API V2 in this case, to get specific cover image of messages using API below.

     

     

     

    SELECT cover_image FROM messages WHERE id='2366'

     

     

     


    I got really good information from this content.thanks for sharing.

  • Hi ianb 

    You can use the following alternative API call to get the cover image:

    [YourCommunityURL]/api/2.0/messages/[messageId]?fields=cover_image

    Cover image is called up explicitly. For more information please refer the following release notes documentation:

    https://community.khoros.com/t5/Developer-Discussion/Get-cover-image-using-API-V1/m-p/582015?utm_source=communitynotification&utm_medium=email&utm_campaign=immediate_general#M16845

    Thanks