ReferenceWhatsApp Business API
Get messages list
GET
By default, the message history is not saved for output in the method. To enable the method, write to technical support
JWT tokenquery
token<token>last?booleanDisplays the last messages. If this parameter is passed, then lastMessageNumber is ignored.
lastMessageNumber?integerThe lastMessageNumber parameter from the last response. Example: 100
firstMessageNumber?integerThe firstMessageNumber parameter from the last response. Example: 1
limit?integerSets length of the message list. Default 100. With value 0 returns all messages.
chatId?stringFilter messages by chatId
Chat ID from the message list. Example: [email protected] (or RU.1504711984690866@lid).
min_time?integerFilter messages received after specified time. Example: 1665396610
max_time?integerFilter messages received before specified time. Example: 1665396610
msgId?stringMessage ID. Example: 0XzkmGNn4prUAQlzsHApGNRXQ0U
Server response example
application/json- response
messages?array<>curl -X GET 'https://api.1msg.io/123/messages?last=true&lastMessageNumber=100&firstMessageNumber=1&limit=200&chatId=556123122026%40c.us&min_time=1665396610&max_time=1665396610&msgId=0XzkmGNn4prUAQlzsHApGNRXQ0U'{ "messages": [ { "messageNumber": 1, "id": "0XzkmGNn4prUAQlzsHApGNRXQ0U", "body": "Test message", "fromMe": true, "self": 1, "isForwarded": 0, "author": "[email protected]", "authorBsuid": "RU.1504711984690866", "authorUserName": null, "time": 1665396610, "chatId": "[email protected]", "type": "chat", "senderName": "[email protected]", "caption": null, "quotedMsgId": null, "meta": {}, "metadata": {}, "chatName": "556123122026" } ]}