0

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.

enter image description here

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

enter image description here

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.

Sachin Trivedi
  • 2,033
  • 4
  • 28
  • 57
  • 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 mentione media details using the mentioned media API https://developers.facebook.com/docs/instagram-api/reference/user/mentioned_media – priyanka Nov 12 '18 at 09:39
  • 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 – priyanka Nov 12 '18 at 09:41
  • @user3351074 Okay great ! So this works right. I just need to submit my app to facebook review ? Also what permission requests should i ask facebook while submitting the app for review ? – Sachin Trivedi Nov 12 '18 at 09:41
  • This page has the details https://developers.facebook.com/docs/instagram-api/reference/user/mentioned_media. I have an app with all the 5 permissions mentioned in the link. – priyanka Nov 12 '18 at 09:43

1 Answers1

0

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

priyanka
  • 315
  • 3
  • 14