Skip to main content

Get Chat Room Members

Retrieve a list of members in a specified chat room. This endpoint allows for fetching the details of chat room members in a paginated format.


GET
    https://api.deadsimplechat.com/consumer/api/v2/room/:roomId/members
info

The auth query parameter is your private key. You can find it in your Dashboard under Developer -> Private Key.

Request

GET /consumer/api/v2/room/:roomId/members

Query Parameters

ParameterDescriptionData TypeDefaultMaximum Value
authGo to Dashboard -> Developer -> Private Key is your authString--
limitThe number of chat room members to return (pagination limit)Number50200
skipThe number of chat room members to skip (pagination offset)Number0-

Path Parameters

ParameterDescriptionData Type
roomIdThe unique identifier for the chat room to get membersString

Responses

Success Response

A JSON object containing the total number of chat room members, the limit and skip parameters for pagination, and an array of user data with associated chat room details.

HTTP Status: 200 OK

Body:

{
"total": 100,
"limit": 50,
"skip": 0,
"data": [
{
"chatRoom": { "name": "sample room", "roomId": "sampleId" },
"user": { "username": "sample username", "profilePic": "sample profile picture URL" },
"roleName": "user", // user, guest, admin, moderator
"lastSeen": "sample date",
"created": "sample creation date"
},
// ...more chat room members
]
}

Error Responses

  • Limit exceeds the maximum value:

    HTTP Status: 400 Bad Request

    Body:

    {
    "error": true,
    "errorMessage": "limit should be less than 200"
    }
  • Invalid API Key:

    HTTP Status: 401 Unauthorized

    Body:

    {
    "error": "Invalid API Key"
    }
  • No API Key Specified:

    HTTP Status: 400 Bad Request

    Body:

    {
    "error": "Please specify API Key"
    }
  • Specified chat room not found:

    HTTP Status: 400 Bad Request

    Body:

    {
    "message": "chatroom of the specified roomId not found"
    }

Code Examples

JavaScript (Fetch API)

fetch("https://api.deadsimplechat.com/consumer/api/v2/room/<ROOM_ID>/members?auth=<YOUR_SECRET_KEY>&limit=<LIMIT>&skip=<SKIP>")