How to retrieve the media owner instagram id when receiving comments from webhook

77 views Asked by At

I'm currently receiving comments via the Instagram webhook. However, the payload doesn't include the media owner's information (specifically the instagram user ID), making it challenging to determine the associated account for the comment's media. While I can use the media ID from the payload, I still need to identify the user in my database to access the access tokens for querying the media ID therefore that route is a no-go.

One approach I'm considering is saving the user's media IDs in my database. Then, when a comment is received from the webhook, I can check if the media ID associated with that comment matches any in my database. This would help identify the media owner and ensure they receive notifications about new comments.

Here is the link to the webhook reference for instagram: https://developers.facebook.com/docs/graph-api/webhooks/reference/instagram/

Has anyone else encountered this issue, or is there a workaround I might be overlooking? Your assistance would be greatly appreciated.

Thank you!

0

There are 0 answers