Instance status#
Incoming webhook of this type contains the instance authorization status data
Configuring an instance
To receive incoming notifications about Instance status, you need to enable the settings using one of the following options:
-
Through console enable the setting
Get notifications about the account authorization state change
-
Through the SetSettings method enable the setting
stateWebhook
Webhook#
Webhook parameters#
Parameter | Type | Description |
---|---|---|
typeWebhook | string | Incoming webhook type. For webhooks of this type the parameter takes on the value stateInstanceChanged |
instanceData | object | Instance data |
timestamp | integer | Event timestamp in UNIX format |
stateInstance | string | Instance state. Have variants: |
notAuthorized - Instance not authorized. For instance authorization refer to Before you start section | ||
authorized - Instance authorized | ||
blocked - Instance banned | ||
sleepMode - Status is out of date. Instance is in sleep mode. The state is possible when the phone is switched off. After the phone is switched on, it may take up to 5 minutes for the instance state to be changed to authorized . | ||
starting - The instance is in the process of starting up (service mode). An instance, server, or instance in maintenance mode is rebooting. It may take up to 5 minutes for the instance state to be set to authorized . | ||
yellowCard - Sending messages has been partially or completely suspended on the account due to spamming activity. Messages sent after receiving the status are stored in the queue to be sent for 24 hours. To continue running the instance, you need to do a reboot of the instance |
instanceData
object parameters
Parameter | Type | Description |
---|---|---|
idInstance | integer | Instance Id. The size of the integer is int64. Values range include from 1 to 10 digits |
wid | string | Account Id in WhatsApp format |
typeInstance | string | Instance messenger type |
Webhook body example#
{
"typeWebhook":"stateInstanceChanged",
"instanceData": {
"idInstance": 1,
"wid": "",
"typeInstance":"whatsapp"
},
"timestamp": 1586700690,
"stateInstance": "notAuthorized"
}