Contact support:
Contact support
Select Language Русский (article not translated) English

    Incoming event “message”

    Example message object (incoming/outgoing message)

    This article contains example message objects that can be received via webhooks and Pusher events. Messages can be either incoming or outgoing, and they are passed as JSON. Depending on the type of message (text, with file, template, etc.), the message object can contain a different set of fields.

    Example text message

    {
     "data": [
       {
         "id": "BAE506C4504E06D8",
         "internalId": 6041,
         "groupId": null,
         "fromApi": true,
         "fromMe": true,
         "side": "out",
         "time": 1727357016,
         "type": "text",
         "subtype": null,
         "message": {
           "text": "Text message",
           "textLang": null,
           "caption": "",
           "file": null,
           "location": null,
           "template": null,
           "html": ""
         },
         "quotedMessage": null,
         "fromUser": {
           "id": "70000000000@c.us",
           "username": null,
           "name": "70000000000",
           "phone": "70000000000",
           "email": null
         },
         "chat": {
           "id": "70000000001@c.us",
           "internalId": 296,
           "fullId": "0fd9e908a1da02732f83f0d08961a59e",
           "hash": null,
           "type": "private",
           "phone": "70000000001",
           "username": null,
           "email": null,
           "name": "Contact name",
           "image": "https://download.samplelib.com/jpeg/sample-green-400x300.jpg",
           "lastTime": 1727357016,
           "automations": {
             "bots": {
               "active": true
             },
             "autoResponses": {
               "active": true
             },
             "triggers": {
               "active": true
             }
           },
           "link": null,
           "tags": null,
           "responsible": null,
           "producer": null,
           "accomplices": null,
           "auditors": null,
           "status": null,
           "level": null,
           "funnelStage": null,
           "responsiblePin": false,
           "process": null,
           "timeLastInMessage": 1727093495,
           "unreadMessages": 1,
           "lastRead": null,
           "advert": null,
           "secondLink": null,
           "subtype": null,
           "inviteLink": null,
           "lastMessage": {
             "type": "text",
             "previewText": "Text message",
             "previewTextLang": null
           },
           "comment": null,
           "consentSendMessage": null,
           "archive": false,
           "created": true, // chat created (new chat)
           "customFields": null
         },
         "fromApp": {
           "id": "app_25095_1",
           "tracking": null,
           "sender": "employee"
         },
         "utm": null,
         "created": {
           "id": 25095
         },
         "forwarded": false,
         "edited": false
       }
     ],
     "meta": {
       "type": "message",
       "licenseId": 1,
       "messengerType": "grWhatsApp"
     }
    }

    Example of a message with a file

    {
     "data": [
       {
         "id": "B4E4501FDF558C8124",
         "internalId": 6182,
         "groupId": null,
         "fromApi": false,
         "fromMe": true,
         "side": "out",
         "time": 1727594205,
         "type": "file",
         "subtype": null,
         "message": {
           "text": "",
           "textLang": null,
           "caption": "",
           "file": {
             "link": "https://s3.us-east-1.wasabisys.com/devapi.chatapp.online/chatFiles/1/grWhatsApp/2024/09/29/97de057c-4e42-4cf-9c1e-56d6.zip",
             "name": "file_name.zip",
             "contentType": "application/zip"
           },
           "location": null,
           "template": null,
           "html": ""
         },
         "quotedMessage": null,
         "fromUser": {
           "id": "70000000000@c.us",
           "username": null,
           "name": "70000000000",
           "phone": "70000000000",
           "email": null
         },
         "chat": {
           "id": "70000000001@c.us",
           "internalId": 296,
           "fullId": "0fd9e908a1da02732f83f0d08961a59e",
           "hash": null,
           "type": "private",
           "phone": "70000000001",
           "username": null,
           "email": null,
           "name": "Contact name",
           "image": "https://download.samplelib.com/jpeg/sample-green-400x300.jpg",
           "lastTime": 1727594205,
           "automations": {
             "bots": {
               "active": true
             },
             "autoResponses": {
               "active": true
             },
             "triggers": {
               "active": true
             }
           },
           "link": null,
           "tags": null,
           "responsible": null,
           "producer": null,
           "accomplices": null,
           "auditors": null,
           "status": null,
           "level": null,
           "funnelStage": null,
           "responsiblePin": false,
           "process": null,
           "timeLastInMessage": 1727093495,
           "unreadMessages": 1,
           "lastRead": null,
           "advert": null,
           "secondLink": null,
           "subtype": null,
           "inviteLink": null,
           "lastMessage": {
             "type": "file",
             "previewText": "",
             "previewTextLang": null
           },
           "comment": null,
           "consentSendMessage": null,
           "archive": false,
           "created": true, // chat created (new chat)
           "customFields": null
         },
         "fromApp": {
           "id": "native",
           "tracking": null,
           "sender": null
         },
         "utm": null,
         "created": null,
         "forwarded": false,
         "edited": false
       }
     ],
     "meta": {
       "type": "message",
       "licenseId": 1,
       "messengerType": "grWhatsApp"
     }
    }

    Voice message example (available for messengers: grWhatsApp, WhatsApp, caWhatsApp, telegram, telegramBot, instagram, facebook, vkontakte)

    {
     "data": [
       {
         "id": "5AF3D76AD402A9ED44",
         "internalId": 6185,
         "groupId": null,
         "fromApi": false,
         "fromMe": true,
         "side": "out",
         "time": 1727595489,
         "type": "audio",
         "subtype": null,
         "message": {
           "text": "",
           "textLang": null,
           "caption": "",
           "file": {
             "link": "https://s3.us-east-1.wasabisys.com/devapi.chatapp.online/chatFiles/1/grWhatsApp/2024/09/29/5ca2f568-2dd8-44a23.oga",
             "name": "ad7383ec-548a-4400-bb46-0c58954f944a.oga",
             "contentType": "audio/ogg; codecs=opus"
           },
           "location": null,
           "template": null,
           "html": ""
         },
         "quotedMessage": null,
         "fromUser": {
           "id": "70000000000@c.us",
           "username": null,
           "name": "70000000000",
           "phone": "70000000000",
           "email": null
         },
         "chat": {
           "id": "70000000001@c.us",
           "internalId": 296,
           "fullId": "0fd9e908a1da02732f83f0d08961a59e",
           "hash": null,
           "type": "private",
           "phone": "70000000001",
           "username": null,
           "email": null,
           "name": "Contact name",
           "image": "https://download.samplelib.com/jpeg/sample-green-400x300.jpg",
           "lastTime": 1727595489,
           "automations": {
             "bots": {
               "active": true
             },
             "autoResponses": {
               "active": true
             },
             "triggers": {
               "active": true
             }
           },
           "link": null,
           "tags": null,
           "responsible": null,
           "producer": null,
           "accomplices": null,
           "auditors": null,
           "status": null,
           "level": null,
           "funnelStage": null,
           "responsiblePin": false,
           "process": null,
           "timeLastInMessage": 1727093495,
           "unreadMessages": 1,
           "lastRead": null,
           "advert": null,
           "secondLink": null,
           "subtype": null,
           "inviteLink": null,
           "lastMessage": {
             "type": "audio",
             "previewText": "",
             "previewTextLang": null
           },
           "comment": null,
           "consentSendMessage": null,
           "archive": false,
           "created": true, // chat created (new chat)
           "customFields": null
         },
         "fromApp": {
           "id": "native",
           "tracking": null,
           "sender": null
         },
         "utm": null,
         "created": null,
         "forwarded": false,
         "edited": false
       }
     ],
     "meta": {
       "type": "message",
       "licenseId": 1,
       "messengerType": "grWhatsApp"
     }
    }

    Example of “Missed call” event (available for messengers: grWhatsApp, telegram)

    {
     "data": [
       {
         "id": "FCF4FCE2FF7ED62BEBC1B6B7755DF9D6",
         "internalId": 6189,
         "groupId": null,
         "fromApi": false,
         "fromMe": false,
         "side": "in",
         "time": 1727595908,
         "type": "call_log",
         "subtype": null,
         "message": {
           "text": "[Call - miss]",
           "textLang": null,
           "caption": "",
           "file": null,
           "location": null,
           "template": null,
           "html": ""
         },
         "quotedMessage": null,
         "fromUser": {
           "id": "70000000001@c.us",
           "username": null,
           "name": "Имя контакта",
           "phone": "70000000001",
           "email": null
         },
         "chat": {
           "id": "70000000001@c.us",
           "internalId": 103,
           "fullId": "3f8a4c14ec994946037ec9955436b34b",
           "hash": null,
           "type": "private",
           "phone": "70000000001",
           "username": null,
           "email": null,
           "name": "Contact name",
           "image": "https://download.samplelib.com/jpeg/sample-green-400x300.jpg",
           "lastTime": 1727595908,
           "automations": {
             "bots": {
               "active": true
             },
             "autoResponses": {
               "active": true
             },
             "triggers": {
               "active": true
             }
           },
           "link": null,
           "tags": null,
           "responsible": null,
           "producer": null,
           "accomplices": null,
           "auditors": null,
           "status": null,
           "level": null,
           "funnelStage": null,
           "responsiblePin": false,
           "process": null,
           "timeLastInMessage": 1727595908,
           "unreadMessages": 1,
           "lastRead": null,
           "advert": null,
           "secondLink": null,
           "subtype": null,
           "inviteLink": null,
           "lastMessage": {
             "type": "call_log",
             "previewText": "[Call - miss]",
             "previewTextLang": null
           },
           "comment": null,
           "consentSendMessage": null,
           "archive": false,
           "created": true, // chat created (new chat)
           "customFields": null
         },
         "fromApp": null,
         "utm": null,
         "created": null,
         "forwarded": false,
         "edited": false
       }
     ],
     "meta": {
       "type": "message",
       "licenseId": 1,
       "messengerType": "grWhatsApp"
     }
    }

    Example of a template message (available for messengers: WhatsApp, caWhatsApp, vkNotify)

    {
      "data": [
        {
          "id": "wamid.HBgLNzk2MTQ5MDIwMzcVAgARGBJCRUI5NkYzRTVGMzM0NTJCQUUA",
          "internalId": 6455,
          "groupId": null,
          "fromApi": true,
          "fromMe": true,
          "side": "out",
          "time": 1727700907,
          "type": "template",
          "subtype": null,
          "message": {
            "text": "Hello WorldnThis is test template text.",
            "textLang": null,
            "caption": "",
            "file": null,
            "location": null,
            "template": {
              "id": "2952652771550190",
              "params": []
            },
            "html": ""
          },
          "quotedMessage": null,
          "fromUser": {
            "id": "70000000000",
            "username": null,
            "name": null,
            "phone": "70000000000",
            "email": null
          },
          "chat": {
            "id": "70000000001",
            "internalId": 241,
            "fullId": "bafb7a957d9da889b22d3dcc76afe5ac",
            "hash": null,
            "type": "private",
            "phone": "70000000001",
            "username": null,
            "email": null,
            "name": "Contact name",
            "image": null,
            "lastTime": 1727700907,
            "automations": {
              "bots": {
                "active": true
              },
              "autoResponses": {
                "active": true
              },
              "triggers": {
                "active": true
              }
            },
            "link": null,
            "tags": null,
            "responsible": null,
            "producer": null,
            "accomplices": null,
            "auditors": null,
            "status": null,
            "level": null,
            "funnelStage": null,
            "responsiblePin": false,
            "process": null,
            "timeLastInMessage": 1726564355,
            "unreadMessages": 1,
            "lastRead": null,
            "advert": null,
            "secondLink": null,
            "subtype": null,
            "inviteLink": null,
            "lastMessage": {
              "type": "template",
              "previewText": "Hello WorldnThis is test template text.",
              "previewTextLang": null
            },
            "comment": null,
            "consentSendMessage": null,
            "archive": false,
            "created": true, // chat created (new chat)
            "customFields": null
          },
          "fromApp": {
            "id": "app_25095_1",
            "tracking": null,
            "sender": "employee"
          },
          "utm": null,
          "created": {
            "id": 25095
          },
          "forwarded": false,
          "edited": false
        }
      ],
      "meta": {
        "type": "message",
        "licenseId": 1,
        "messengerType": "caWhatsApp"
      }
    }