GET graph.user.messages
Get chat messages by chat ID
Name | Required | Type | Default value | Description |
---|---|---|---|---|
chat:id | true | | Chat ID in a chat:id format | |
from | false | | 9223372036854775807 | Timestamp of the latest created message |
to | false | | 0 | Timestamp of the first created message |
count | false | | 50 | Amount of messages to return |
include_deleted | false | | Include deleted messages in response. If this feature is required please send a request to api-support@ok.ru. Group ID should be specified in a request |
It must be noted tha messages are sorted by time of their creation in descending order. Therefore from parameter must be greater than to parameter.
Messages from a specific chat can be acquired via this method and chat ID can be set as a PATH parameter or as a GET=parameter.
Request example
Chat ID as a PATH parameter
?access_token=tkn18YdUJZe:CQABPOJKAKEKEKEKE
&from=1498581292941
&to=1498577000197
&count=2
Chat Id as a GET parameter
?access_token=tkn18YdUJZe:CQABPOJKAKEKEKEKE
&chat_id=chat:C3ecb9d02a600
&from=1498581292941
&to=1498577000197
&count=2
Response
Attachment types
Following attachments types can be a part of message:
- type=IMAGE - image attachment;
- type=VIDEO - video attachment (OK video or a link to i.e. youtube video);
- type=AUDIO - audio attachment (user recorded audio or link to a music track on OK);
- type=SHARE - a link share that was processed by our grabber.
Service messages
In addition to user-created messages there exists a list of special service messages:
- user leaving a chat