Webhooks를 사용하면 Meta 소셜 그래프에 있는 특정 개체의 변경 사항에 대한 실시간 HTTP 알림을 받을 수 있습니다. 예를 들어 고객이 비즈니스의 Instagram 프로페셔널 계정에 메시지를 보내면 Facebook에서 해당 비즈니스로 알림을 보낼 수 있습니다. Webhooks 알림을 사용하면 메시지 변경 사항을 추적하고 Messenger 플랫폼 엔드포인트를 쿼리하여 변경 사항을 추적할 경우에 발생하는 사용 제한을 피할 수 있습니다.
Instagram 메시지용 Webhooks 알림을 수신하려면 다음 요구 사항을 구현해야 합니다.
instagram_basic
, instagram_manage_messages
및 pages_manage_metadata
권한참고: 비즈니스의 모든 메시지 앱이 메시지 전송 Webhooks를 구독해야 합니다.
액세스 레벨 , 앱 모드 및 앱 역할에 대해 자세히 알아보세요.
Webhooks 필드 | 설명 |
---|---|
| 고객이 메시지에 공감하거나 공감을 취소할 때 알림이 전송됩니다. 그래프 API v12.0 이상에서는 |
| 고객이 비즈니스에 다음을 보냈을 때 알림이 전송됩니다.
비즈니스가 고객에게 메시지를 보낼 때도 알림이 전송됩니다. 비즈니스가 고객의 메시지에 공감하거나 공감을 취소할 때 알림이 전송되지 않습니다. Instagram 계정에서 메시지를 전송했을 때 이 콜백이 발생합니다. |
| 고객이 아이스 브레이커 옵션이나 일반 템플릿 버튼을 클릭했을 때 알림이 전송됩니다. v8.0 이상이 필요합니다. |
| 받는 사람이 메시지를 읽은 경우에 알림이 전송됩니다. |
| 기존 대화에서 고객이 리퍼럴 매개변수가 있는 |
| 메시지 플로에 여러 앱이 있을 때 고객이 비즈니스에 메시지를 전송했지만 메시지를 전송한 시점에 앱에 대화 관리 권한이 없을 경우에 알림이 전송됩니다. |
비즈니스가 수신할 수 있는 Webhooks 알림 유형의 예시는 다음과 같습니다.
{ "object": "instagram", "entry": [ { "id": "IGID", // ID of your Instagram Professional account "time": 1569262486134, "messaging": [ { "sender": { "id": "IGSID" }, // Instagram-scoped ID for the customer who sent the message "recipient": { "id": "IGID" }, // ID of your Instagram Professional account "timestamp": 1569262485349, "message": { "mid": "MESSAGE-ID", // ID of the message sent to your business "text": "MESSAGE-TEXT" // Included when a customer sends a message containing text "attachments": [ // Included when a customer sends multiple media attachments or a URL for a story mention or share { "type":"image", // Can be audio, file, image (image or sticker), share, story_mention, or video "payload":{ "url":"LINK" } }, { "type":"video", "payload":{ "url":"LINK" } } ] "is_deleted": true // Included when a customer deletes a message "is_echo": true // Included when your business sends a message to the customer "is_unsupported": true, // Included when a customer sends a message with unsupported media "quick_reply": { // Included when a customer clicks a quick reply "payload": "CUSTOMER-RESPONSE-PAYLOAD" // The payload with the option selected by the customer }, "referral": { // Included when a customer clicks an Instagram Shop product "product": { "id": "PRODUCT-ID" } "referral": { // Included when a customer clicks an CTD ad "ref": "REF-DATA-IN-AD-IF-SPECIFIED" "ad_id": AD-ID, "source": "ADS", "type": "OPEN_THREAD", "ads_context_data": { "ad_title": TITLE-FOR-THE-AD, "photo_url": IMAGE-URL-THAT-WAS-CLICKED, "video_url": THUMBNAIL-URL-FOR-THE-AD-VIDEO, } } "reply_to":{ // Included when a customer sends an inline reply "mid":"MESSAGE-ID" } "reply_to": { // Included when a customer replies to a story "story": { "url":"CDN-URL", "id":"STORY-ID" } } } } ] } ] }
{ "object": "instagram", "entry": [ { "id": "IGID", // ID for your Instagram Professional account "time": 1569262486134, "messaging": [ { "sender": { "id": "IGSID" // Instagram-scoped ID for the customer who sent the message }, "recipient": { "id": "IGID" // ID for your Instagram Professional account }, "timestamp": 1569262485349, "reaction" :{ "mid" : "MESSAGE-ID", "action": "react", // or unreact "reaction": "love", // optional, to unreact if there is no reaction field "emoji": "\u{2764}\u{FE0F}" // optional, to unreact if there is no emoji field } } ] } ] }
{ "object": "instagram", "entry": [ { "id": "IGSID", // ID of your Instagram Professional account "time": 1502905976963, "messaging": [ { "sender": { "id": "IGSID" }, // Instagram-scoped ID for the customer who sent the message "recipient": { "id": "IGID" }, // ID of your Instagram Professional account "timestamp": 1502905976377, "postback": { "mid":"MESSAGE-ID", // ID for the message sent to your business "title": "SELECTED-ICEBREAKER-REPLY-OR-CTA-BUTTON", "payload": "CUSTOMER-RESPONSE-PAYLOAD", // The payload with the option selected by the customer } } ] } ] }
{ "object": "instagram", "entry": [ { "id": "IGSID", // ID of your Instagram Professional account "time": 1502905976963, "messaging": [ { "sender": { "id": "IGSID" // Instagram-scoped ID for the customer who sent the message }, "recipient": { "id": "IGID" // ID of your Instagram Professional account }, "timestamp": 1502905976377, "referral": { "ref": "INFORMATION-INCLUDED-IN-REF-PARAMETER-OF-IGME-LINK" "source": "IGME-SOURCE-LINK" "type": "OPEN_THREAD" // Only supported for existing conversations } } ] } ] }
{ "object":"instagram", "entry":[ { "id":"IGID", // ID for your Instagram Professional account "time":1569262486134, "messaging":[ { "sender":{ "id":"IGSID" // Instagram-scoped ID for the customer who sent the message }, "recipient":{ "id":"IGID" // ID for your Instagram Professional account }, "timestamp":1569262485349, "read":{ "mid":"MESSAGE-ID" } } ] } ] }