Instagram Mention API - not able to retrieve media details in DEV mode

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 00:05:18

问题


Since the existing instagram APIs are deprecated, I am switching to the graph api. Below is what i want to achieve and what the issue is.

Requirement.

  1. I would like to track the number of likes and comments on instagram posts in which my business account is mentioned using @. I have setup the faccebook and instagram accounts along with the webhook. The webhook is going to send me the "mediaid" in which i my business account is tagged.

Since the app is in the development mode i am not receiving the webhooks if i mention the business account in any of the post, but i am able to send the test webhook from the developer account console. So i assume once the app is in LIVE mode it will start sending the webhooks to my server.

  1. Once the "mediaid" is received i would like to make a call to another api https://developers.facebook.com/docs/instagram-api/reference/user/mentioned_media in order to get the number of likes and comments.

I am facing an issue on the 2nd part. Whenever i call the api mentioned in the 2nd part i am getting the error

This api call works fine when i pass the mediaid that my instagram business account owns. But as soon as i pass the mediaid of the post which mentioned my business i am getting the above error.

I just wanted to check if this is also a limitation of my facebook app being in a development mode ? Please suggest a solution to achieve this scenario.


回答1:


I tried the same what you did but with a live facebook app. From the webhook, I got an event when any other user mentioned my instagram business handle in caption and am able to fetch the mentioned media details using the mentioned media API https://developers.facebook.com/docs/instagram-api/reference/user/mentioned_media.

As you didn't share the webhook event payload, I am just assuming you are using the correct user id while making the API call. The JSON path of the user id in event payload is entry[0].id



来源:https://stackoverflow.com/questions/53078441/instagram-mention-api-not-able-to-retrieve-media-details-in-dev-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!