1

I am currently doing an integration to the Instagram API and would like my app to receive webhook notifications whenever there is new media on any Instagram account which has authorized my app via OAuth.

I've been able to write the code which sets up my app to receive notifications using the instructions here. However, I noticed that the Instagram API docs contain no information on what the data in a change notification will look like. My searches online have also come back void. I need sample Instagram webhook notification data so I can write code to parse the data and apply it for my purposes.

I would have gone ahead to expose my localhost to the internet via ngrok, so Instagram would send data to my callback URL when I post a photo to my Instagram account. However, I discovered that the Instagram API does not allow you use an ngrok URL as a callback URL.

Now the only option I have is to deploy my partially completed code to an actual web server. Hoping someone else who has previously integrated to the API can share the format of the webhook notification data. I really don't want to have to do deploy my application at this point.

2
  • It seems they are not supporting the webhook notifications now. Please let me know if you are still able to get notifications? I can't see any documentation on the link you provided.
    – SamFast
    Apr 16, 2018 at 4:30
  • 1
    I have also looked into the documentation. It appears like they have stopped support for the webhook notifications as the link to the documentation for webhook subscriptions is now broken. That's unfortunate. I'm guessing you might want to look into the Facebook graph API as I'm aware it's possible to get Instagram webhook notifications through the API if you link the Facebook page to the Instagram profile. Apr 17, 2018 at 10:29

1 Answer 1

2

I eventually had to deploy my partially completed code to a web server. I put a logger behind my webhook callback URL to record the notification data sent to it by Instagram. Below is what it looks like:

[
    {
        "object": "user",
        "object_id": "123456789",
        "changed_aspect": "media",
        "time": 1506338651,
        "data": {
            "media_id": "1611605324545559190_123456789"
        },
        "subscription_id": 0
    }
]

The Instagram webhook notification payload/data is a JSON array of objects, each of which contains information on a single change to an Instagram account. Each JSON object contains the following fields:

  • object: A string whose value is always "user"
  • object_id: The ID of the Instagram account on which the subject change occurred
  • changed_aspect: A string whose value is always "media"
  • time: The Unix epoch indicating when the subject change occurred
  • subscription_id: The ID of the Instagram subscription object through which this notification was sent. A subscription object is created to ask Instagram to send webhook notifications to your app and is essentially a callback URL.
  • data: A JSON object containing the following fields:
    • media_id: The ID of the new Instagram media object (photo, video or carousel) whose creation triggered this webhook notification
1
  • It would be very helpful to know the instagram json that is received from the webhook when a comment occurs, for my application I need the id of the account where the change occurs and the id of the user that produces it, thanks in advance
    – JG73
    Feb 4, 2021 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.