GET Chat
List Events By Type
This method enables you to retrieve a small list of recent events by type.
- This method enables you to retrieve a small list of recent events by type. This is useful for things like fetching a list of recent announcements or custom event types without the need to scroll through the entire chat history.
- This method returns a list of events sorted from newest to oldest.
- This method returns only active events.
- If you specify eventtype = customtype, you must pass the customtype value, a string of your choosing for your custom type.
URL PARAMETERS
- limit : (Optional) Defaults to 10, maximum 100.
- cursor: (Optional) 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.
- eventtype : (Optional) Specify the chat event type you are filtering for. If you want to filter for a custom event type, specify 'custom' and then provide a value for the *customtype parameter
- customtype : (Optional) If you want to filter by custom type you must first specify 'custom' for the eventtype field. This will enable you to filter to find events of a custom type.
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 EventType query integer · int32
Example: [object Object] CustomType query string
limit query integer · int32
The maximum number of records to return.
Example:100 cursor query string
The cursor returned by the previous page.
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.chatevents",
"cursor": "637477362782873373",
"more": false,
"itemcount": 1,
"events": [
{
"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": []
}
]
}
}