Get Chat Messages
GET/chat.history
List messages in a chat, filtered by date range (after/before).
The ordering of results depends on ascending and after:
-
ascending=truesorts in forward chronological order (oldest first).ascending=falsesorts in reverse chronological order (newest first), even whenafteris specified. -
When
ascendingis omitted andafteris not specified, the most recent messages are returned in reverse chronological order. This is equivalent to specifyingbeforeas NOW and leavingafterunspecified. -
When
ascendingis omitted andafteris specified, the results are sorted in forward chronological order.
Send the same ascending value on every page. The cursor marks where to
resume, not which direction to sort.
Either dates or datetimes may be specified. Dates are interpreted in UTC.
Note that the API operates in UTC with respect to the date range filter.
Access: Organization and Personal. In Personal mode, only chats where the authenticated user is a participant are accessible.
Required scope: chat:history
OpenAPI Spec: chat.json
Request
Responses
- 200
- 400
- 401
- 403
- 405
- 500
Info retrieved successfully
Bad request, including an unparseable ascending value (code is invalid_parameter).
Presented invalid authentication credentials.
Bot is not a member of this chat.
An unsupported method was requested.
An internal error occured.