Skip to API content
TalkLabs API Docs v3
Recipes
GET Chat

List Events By Timestamp

This method enables you to retrieve an event using a timestamp.

GET /api/v3/{appid}/chat/rooms/{roomid}/eventsbytimestamp/list/{ts}
  • This method enables you to retrieve an event using a timestamp.
  • You can optionally retrieve a small number of displayable events before and after the message at the requested timestamp.
  • This method returns a list of events sorted from oldest to newest.
  • This method returns only active events.
  • The timestamp is a high resolution timestamp accurate to the thousanth of a second. It is possible, but very unlikely, for two messages to have the same timestamp.
  • The method returns "timestampolder". This can be passed as the timestamp value when calling functions like this which accept a timestamp to retrieve data.
  • The method returns "timestampnewer". This can be passed as the timestamp value when calling this function again.
  • The method returns "cursorpolder". This can be passed as the cursor to ethods that accept an events-sorted-by-time cursor.
  • The method returns "cursornewer". This can be passed as the cursor to methods that accept an events-sorted-by-time cursor.

LIMITATIONS

If you pass in 0 for limitolder you won't get any older events than your timestamp and hasmoreolder will always be false because the API will not query for older events. If you pass in 0 for limitnewer you won't get any newer events than your timestamp and hasmorenewer will always be false because the API will not query for newer events.

URL PARAMETERS

  • ts: (Required) If not provided, the most recent events will be returned. To get older events, call this method again using the cursor string returned from the previous call.
  • limitolder : (Optional) Defaults to 0, maximum 100.
  • limitnewer : (Optional) Defaults to 0, maximum 100.
Request

Parameters

Values in the path and query string.

appid path
string TalkLabs ID required

The TalkLabs application ID assigned to your account.

Example: your-app-id
roomid path
string TalkLabs ID required

The TalkLabs assigned room ID returned when the room was created.

Example: room-id
ts path
integer · int64 required

An ISO 8601 timestamp.

Example: 1
limitolder query
integer · int32
Example: 0
limitnewer query
integer · int32
Example: 0
Response

Status codes

Every JSON response uses the API result envelope.

200 OK ApiResult
400 Bad Request ApiResult
403 Forbidden ApiResult
404 Not Found ApiResult
500 Internal Server Error ApiResult
Example response · 200
{
  "message": "",
  "errors": {},
  "data": {
    "kind": "list.chateventsbytimestamp",
    "cursorolder": "637477180206230222",
    "cursornewer": "637477362782873373",
    "timestampolder": 637477180206230300,
    "timestampnewer": 637477362782873300,
    "hasmoreolder": true,
    "hasmorenewer": false,
    "itemcount": 2,
    "events": [
      {
        "kind": "chat.event",
        "id": "601704845617e4176c05e5c7",
        "roomid": "600d78d45617e20e34c39dd5",
        "body": "That's another pickle you've gotten us into Ollie!",
        "originalbody": "",
        "added": "2021-01-31T19:27:00.6230222Z",
        "modified": "2021-01-31T19:27:00.6230222Z",
        "ts": 637477180206230300,
        "eventtype": "custom",
        "userid": "bobsmith4",
        "user": {
          "kind": "app.user",
          "userid": "bobsmith4",
          "handle": "dave_m75962",
          "handlelowercase": "georgew75962",
          "displayname": "Dave M.",
          "pictureurl": "https://example.com/users/u-8842s/photos/original/a9/c7/a6/44-1-george-washington-18-1549729902.jpg",
          "profileurl": "https://example.com/users/u-8842shington",
          "role": "admin",
          "customtags": [],
          "banned": false,
          "shadowbanned": false,
          "shadowbanexpires": "0001-01-01T00:00:00Z",
          "muted": false,
          "moderation": "approved",
          "reports": []
        },
        "mentions": [],
        "customtype": "pickles",
        "customid": "",
        "custompayload": "",
        "customtags": [],
        "customfield1": "",
        "customfield2": "",
        "replyto": null,
        "parentid": "",
        "hierarchy": [],
        "depth": 0,
        "edited": false,
        "editedbymoderator": false,
        "censored": false,
        "deleted": false,
        "active": true,
        "mutedby": [],
        "shadowban": false,
        "hashtags": [],
        "likecount": 0,
        "replycount": 0,
        "reactions": [],
        "moderation": "na",
        "reports": []
      },
      {
        "kind": "chat.event",
        "id": "60174bd65617e6176c7aaf1a",
        "roomid": "600d78d45617e20e34c39dd5",
        "body": "this is an announcement by the admin.",
        "originalbody": "",
        "added": "2021-02-01T00:31:18.2873373Z",
        "modified": "2021-02-01T00:31:18.2873373Z",
        "ts": 637477362782873300,
        "eventtype": "announcement",
        "userid": "bobsmith4|600d78305617e20e34c39bb2",
        "user": {
          "kind": "app.user",
          "userid": "bobsmith4",
          "handle": "dave_m75962",
          "handlelowercase": "georgew75962",
          "displayname": "Dave M.",
          "pictureurl": "https://example.com/users/u-8842s/photos/original/a9/c7/a6/44-1-george-washington-18-1549729902.jpg",
          "profileurl": "https://example.com/users/u-8842shington",
          "role": "admin",
          "customtags": [],
          "banned": false,
          "shadowbanned": false,
          "shadowbanexpires": "0001-01-01T00:00:00Z",
          "muted": false,
          "moderation": "approved",
          "reports": []
        },
        "mentions": [],
        "customtype": "",
        "customid": "",
        "custompayload": "",
        "customtags": [],
        "customfield1": "",
        "customfield2": "",
        "replyto": null,
        "parentid": "",
        "hierarchy": [],
        "depth": 0,
        "edited": false,
        "editedbymoderator": false,
        "censored": false,
        "deleted": false,
        "active": true,
        "mutedby": [],
        "shadowban": false,
        "hashtags": [],
        "likecount": 0,
        "replycount": 0,
        "reactions": [],
        "moderation": "na",
        "reports": []
      }
    ]
  }
}
Search all 118 endpoints Try “join room”, “moderate”, or “POST”.
Request environment

Connect your application

These values fill request examples and the API console. They stay in this browser tab and are never sent to TalkLabs until you run a request.

Credentials are stored in sessionStorage, not in cookies or analytics.