1MSG

Get messages list

GET
/messages

By default, the message history is not saved for output in the method. To enable the method, write to technical support

Authorization

JWT token
querytoken<token>

Query Parameters

last?boolean

Displays the last messages. If this parameter is passed, then lastMessageNumber is ignored.

lastMessageNumber?integer

The lastMessageNumber parameter from the last response. Example: 100

firstMessageNumber?integer

The firstMessageNumber parameter from the last response. Example: 1

limit?integer

Sets length of the message list. Default 100. With value 0 returns all messages.

chatId?string

Filter messages by chatId

Chat ID from the message list. Example: [email protected] (or RU.1504711984690866@lid).

min_time?integer

Filter messages received after specified time. Example: 1665396610

max_time?integer

Filter messages received before specified time. Example: 1665396610

msgId?string

Message ID. Example: 0XzkmGNn4prUAQlzsHApGNRXQ0U

Response Body

Server response example

application/json
  1. 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"    }  ]}