messaging_game_plays
Webhook Event ReferenceThis callback occurs after a person played a round of Instant Games. To receive this event, you must subscribe to this callback by selecting the messaging_game_plays
field when setting up your webhook.
{
"sender": {
"id": "<PSID>"
},
"recipient": {
"id": "<PAGE_ID>"
},
"timestamp": 1469111400000,
"game_play": {
"game_id": "<GAME-APP-ID>",
"player_id": "<PLAYER-ID>",
"context_type": "<CONTEXT-TYPE:SOLO|THREAD>",
"context_id": "<CONTEXT-ID>", # If a Messenger Thread context
"score": <SCORE-NUM>, # If a classic score based game
"payload": "<PAYLOAD>" # If a rich game
}
}
sender
Property | Type | Description |
---|---|---|
| String | The PSID of the user that triggered the webhook event. |
| String | The user_ref of the user that triggered the webhook event. This is only available for webhook event from the chat plugin. |
recipient
Property | Type | Description |
---|---|---|
| String | Your Page ID. |
game_play
Property | Description | Type | Values |
---|---|---|---|
| App ID of the game | String | |
| ID of the user in the Instant Game name-space. By linking this ID to the | String | |
| Type of the social context a game is played in. | String | SOLO|THREAD|GROUP |
| ID of the context if not a SOLO type. This ID is in the Instant Game name-space. | String | |
| Best score achieved by this user in this game round. Only available to Classic score based games. | Integer | |
| JSON encoded payload data, set using | String |
You must respond to the callback with an HTTP status of 200
.