Forum Discussion

safikhan's avatar
4 years ago

Image attachment is a message_type = message with unique conversation_id

Hi,

I came across how events are recorded and reported through Khoros API and was wondering if someone can help me answer couple of questions based on my exploratory work:

1) Why are images recorded as a separate event with their own stand alone unique conversation_id even when they are part of the same reply or initial post to start the thread (attached pics reflect it as an example)

2) How can we connect these image events back to original conversation_id or message_id they are actually linked with?

Looking forward to your feedback! Any help understanding this will be highly appreciated. 

CC: tyw 

4 Replies

  • Claudius's avatar
    Claudius
    Boss
    4 years ago

    The examples of media uploads I found in my data so far are actually avatar uploads, so they are not tied to a message id. They will all land in the user's media album though which is what explains why they are registered as a "publish" event. I agree though that it is confusing that it's a "message.publish" event and not a "media.publish" event. 

  • Claudius's avatar
    Claudius
    Boss
    4 years ago

    After further digging into the depths of the Bulk Data API it looks to me like there is indeed no event triggered that would help you establish the relationship between media and - if and where - it is being used within a conversation topic.

    The message.publish events you found for media uploads seem to be triggered either during the avatar upload flow or on the post message page (e.g. while the message editor is opened and the "upload media" feature of the rich text editor is being used). But there is no event listed on bulk data event list that ties the media on post creation to the actual message.

    An alternative to obtain which message(s) an image is being used in would be to use API v2 and a LiQL query like:

    SELECT id FROM images WHERE messages.id ='187'

    See the LiQL reference for the 'images' collection

  • safikhan's avatar
    safikhan
    Guide
    4 years ago

    Thanks Cladius for looking into this.  Yeah, the only way I was able to establish the relationship was due to timestamp and action taken and check that across multiple users/posts/messages to validate it. 

    As I understand, since each media file is a message.publish event with its own unique and completely different message and conversation ids I don't think the LIQL query you wrote would be able to establish the one-one relationship because we would not know the message id in the images table. 

    Please let me know if I am missing something here.