[go: up one dir, main page]

Skip to content

Instance socket status#

This type webhook contains socket state data (whether instance is ready to send/receive messages)

Configuring an instance

To receive incoming notifications about Instance status, you need to enable the settings using one of the following options:

  1. Through console enable the setting Get notifications about the account authorization state change

  2. Through the SetSettings method enable the setting stateWebhook

Webhook#

Webhook parameters#

Parameter Type Description
typeWebhook string Webhook type. For this type notifications the parameter takes on value statusInstanceChanged
instanceData object Instance data
timestamp integer Event timestamp in UNIX format
statusInstance string Instance status. Takes on values:
online - Instance can receive/send messages, socket is open
offline - Instance can't receive/send messages, socet is closed

instanceData object parameter

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 Messenger type for instance

Webhook body example#

{
    "typeWebhook":"statusInstanceChanged",
    "instanceData": {
        "idInstance": 1,
        "wid": "11001234567@c.us",
        "typeInstance":"whatsapp"
    },
    "timestamp": 1586700690,
    "statusInstance": "online"
}