Table of Contents

Retrieving chat message history

This command retrieves message history from the specified chat. You can get up to 100 messages, no older than 90 days. The request is synchronous, meaning the response is returned directly to the request, not to a WebHook.

Request command

To retrieve chat history, send a POST request to:

https://whatsgate.org/api/v1/get-history

Request body object

The request body must contain:

{
  "WhatsappID": "YOUR_WHATSAPP_ID",
  "recipient": {
    "id": "79999999999@c.us"
  }
}

Response object

Successful response object

{
  "result": "OK"
  "data": [
        {
            "id": "false_79999999999@c.us_17AC61BFA5A561B7EE42F98810EDFFC4",
            "ack": 0,
            "hasMedia": false,
            "mediaKey": "",
            "body": "Hello world!",
            "type": "chat",
            "timestamp": 1667296242,
            "from": "79999999999@c.us",
            "to": "79999999999@c.us",
            "isForwarded": false
        }
    ]
}