This is not the latest version of this API. Use Message Persistence instead.
This function fetches historical messages of a channel. It is possible to control how messages are returned and in what order, for example you can:
- Search for messages starting on the newest end of the timeline (default behavior -
- Search for messages from the oldest end of the timeline by setting
- Page through results by providing a
- Retrieve a slice of the time line by providing both a
- Limit the number of messages to a specific quantity using the
- Array Element 0 – Array – Contains an array of JSON messages. Array will be between 0 and 100 in length, based on the count parameter (default 100) used at request time, and the number of valid messages available for the given time-slice.
- Array Element 1 – Int – Start Timetoken of returned results,
- Array Element 2 – Int – End Timetoken of returned results, Successful (HTTP Status 200) History() calls will always return a three-element array similar to:
[ [MSG1, MSG2, ...], START_TIMETOKEN, END_TIMETOKEN ]
In the event of an error, you will receive a non-200 HTTP status code. Depending on the error, you may or may not have a parseable array returned.
Page through History v2, traversing newest to oldest: Perform the initial history request, without any start or end parameters (we'll limit results to two at a time to make this example easier to grok):
Using the start Timetoken provided from the last response, use as the start parameter for the next page:
Repeat, until you get 0 (zero) back as a start Timetoken. This indicates you are at the end of the list.