Subscribing to Instagram

Medallia Experience Cloud integration with Facebook Graph API through webhooks for Instagram allows Experience Cloud to receive real-time notifications of changes to specific objects in the Facebook Social Graph (that is, Instagram comments and mentions).
Important: Our integration with this API for Facebook as a social networking source currently does not use webhooks, so data for Facebook notifications is not collected in real time.
This API will be used by the external service provided by Facebook to notify Medallia when there is a new event for one of the Instagram pages from which we collect data (Instagram comments, media published by the Instagram page or mentions of the page made in other comments).
Note: To use this API, customers must have already created a Facebook application, and to receive live updates from their Facebook app, this application must be added to their page’s subscribed applications. For more information about how to configure your app, see Social Networking sources.

The API supports two types of HTTPS requests: verification requests and event notifications.

Verification requests

Facebook uses this request to verify that the endpoint is valid. It is used once when the service is configured.

URL and endpoint

The URL follows this format:

https://social-realtime.medallia.com/instagram

Facebook will send an HTTP GET request to this callback URL.

Sample request

GET https://social-realtime.medallia.com/instagram?hub.mode=subscribe&hub.challenge=1158201444&hub.verify_token=someSecretToken

Content-Type: application/json

Response

The endpoint returns the hub.challenge value in the body of the response.

Sample response - 200 - OK

1158201444

Validating the verification requests

Whenever the endpoint receives a verification request, it will:
  • Verify that the hub.verify_token value is valid.

  • Respond with the hub.challenge value.

Note: To see how the validation process is carried out in more detail, see the Facebook documentation.

Event notifications

Whenever there's a change to the fields on post comments and mentions, Facebook will send an HTTP POST request with a JSON payload describing the change.

URL and endpoint

The URL follows this format:

https://social-realtime.medallia.com/instagram

Payloads contain an object describing the change, thus the contents and structure of each payload varies depending on the object fields that have been modified.

Sample request

POST https://social-realtime.medallia.com/instagram

Content-Type: application/json

X-Hub-Signature: sha1=7c85a2066a5f9d5889579d5ab8bdcf84ae387773

{
    "object": "instagram",
    "entry": [
        {
            "id": "17841440972068431",
            "time": 1603993001,
            "changes": [
                {
                    "value": {
                        "media_id": "18168193117056134",
                        "comment_id": "17867962958101211"
                    },
                    "field": "mentions"
                }
            ]
        }
    ]
}

Response

The endpoint returns standard HTTP response status codes.