Subscribing to Instagram
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
-
Verify that the
hub.verify_tokenvalue is valid. -
Respond with the
hub.challengevalue.
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.
