Skip to API content
TalkLabs API Docs v3
Recipes
GET Chat

List Messages By User

The purpose of this method is to get a list of messages or comments by a user, with count of replies and reaction data.

GET /api/v3/{appid}/chat/rooms/{roomid}/messagesbyuser/{userid}

This method requires authentication.

The purpose of this method is to get a list of messages or comments by a user, with count of replies and reaction data. This way, you can easily make a screen in your application that shows the user a list of their comment contributions and how people reacted to it.

URL PARAMETERS

  • roomid : (required) The ID of the chatroom to retreive the messages by this user from
  • userid : (required) The ID of the user to fetch messages by
  • cursorid : (optional) If null / "", starts at the first messsage, and if not null, resumes cursoring
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
userid path
string customer-defined required

The customer defined user ID from your application or identity system.

Example: u-8842
cursor query
string

The cursor returned by the previous page.

limit query
integer · int32

The maximum number of records to return.

Example: 200
Response

Status codes

Every JSON response uses the API result envelope.

200 OK ApiResult
400 Bad Request ApiResult
403 Forbidden ApiResult
500 Internal Server Error ApiResult
Example response · 200
{
  "message": "",
  "errors": {},
  "data": {
    "kind": "list.chatevents",
    "cursor": "5ec4aa385617e40ed4e82aaf",
    "events": [
      {
        "kind": "chat.event",
        "id": "5ec4aa2b5617e40ed4e82aad",
        "roomid": "5ec3c1945617e21bd8c5567b",
        "body": "Hello, Dev World!",
        "added": "2020-05-20T03:55:22.9999147Z",
        "ts": 637255437229999100,
        "eventtype": "speech",
        "userid": "userid_abe",
        "user": {
          "kind": "app.user",
          "userid": "userid_abe",
          "handle": "HonestAbe",
          "handlelowercase": "honestabe",
          "displayname": "Abraham Lincoln",
          "pictureurl": "https://www.biography.com/.image/ar_1:1%2Cc_fill%2Ccs_srgb%2Cg_face%2Cq_auto:good%2Cw_300/MTU5MDUzMTE0Mzk2MTI0OTUy/abraham-lincoln-1809---18652c-sixteenth-president-of-the-united-states-of-america-photo-by-stock-montagestock-montagegetty-images_promo.jpg",
          "profileurl": "https://www.biography.com/us-president/abraham-lincoln",
          "banned": false
        },
        "customtype": "",
        "customid": "",
        "custompayload": "",
        "customtags": [],
        "customfield1": "",
        "customfield2": "",
        "replyto": null,
        "parentid": "",
        "hierarchy": [],
        "edited": false,
        "deleted": false,
        "active": true,
        "mutedby": [],
        "shadowban": false,
        "hashtags": [],
        "likecount": 0,
        "replycount": 0,
        "reactions": [],
        "moderation": "na",
        "reports": []
      },
      {
        "kind": "chat.event",
        "id": "5ec4aa385617e40ed4e82aaf",
        "roomid": "5ec3c1945617e21bd8c5567b",
        "body": "Hello a second time!",
        "added": "2020-05-20T03:55:36.9845354Z",
        "ts": 637255437369845400,
        "eventtype": "speech",
        "userid": "userid_abe",
        "user": {
          "kind": "app.user",
          "userid": "userid_abe",
          "handle": "HonestAbe",
          "handlelowercase": "honestabe",
          "displayname": "Abraham Lincoln",
          "pictureurl": "https://www.biography.com/.image/ar_1:1%2Cc_fill%2Ccs_srgb%2Cg_face%2Cq_auto:good%2Cw_300/MTU5MDUzMTE0Mzk2MTI0OTUy/abraham-lincoln-1809---18652c-sixteenth-president-of-the-united-states-of-america-photo-by-stock-montagestock-montagegetty-images_promo.jpg",
          "profileurl": "https://www.biography.com/us-president/abraham-lincoln",
          "banned": false
        },
        "customtype": "",
        "customid": "",
        "custompayload": "",
        "customtags": [],
        "customfield1": "",
        "customfield2": "",
        "replyto": null,
        "parentid": "",
        "hierarchy": [],
        "edited": 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.