问题
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.
- 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.
- 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