Get Member's Chat Rooms
Retrieve a list of chat rooms to which a specific user belongs.
GET
https://api.deadsimplechat.com/consumer/api/v2/user/:uniqueUserIdentifier/rooms
Request
GET /consumer/api/v2/user/:uniqueUserIdentifier/rooms
info
The auth
query parameter is your private key. You can find it in your Dashboard under Developer -> Private Key.
Query Parameters
Parameter | Description | Data Type |
---|---|---|
auth | Go to Dashboard -> Developer -> Private Key is your auth | String |
Path Parameters
Parameter | Description | Data Type |
---|---|---|
uniqueUserIdentifier | Unique Identifier for the user | String |
Responses
Success Response
A JSON array containing the chat rooms the user is a member of. Each object in the array will have the following fields:
Field | Description | Data Type |
---|---|---|
roomId | The unique identifier for the chat room | String |
name | The name of the chat room | String |
HTTP Status: 200 OK
Body Example:
[
{
"roomId": "12345",
"name": "General Chat"
},
{
"roomId": "67890",
"name": "Technical Support"
}
]
Error Responses
User not found:
HTTP Status:
400 Bad Request
Body:
{
"message": "user not found"
}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"
}
Code Examples
JavaScript (Fetch API)
fetch("https://api.deadsimplechat.com/consumer/api/v2/user/<USER_IDENTIFIER>/rooms?auth=<YOUR_SECRET_KEY>")