-
Notifications
You must be signed in to change notification settings - Fork 1.6k
API: Rooms
Simon Bartlett edited this page Feb 6, 2015
·
2 revisions
Retrieve all rooms in a JSON list
Param | Example | Default | Description |
---|---|---|---|
skip | 100 |
0 | Specifies the number of rooms to skip |
take | 100 |
500 | Specifies the number of rooms to return (Max: 5000) |
GET /rooms
[
{
"id": "54b881cc1d0e11af0e0180f9",
"slug": "lobby",
"name": "Lobby",
"description": "Come and chat here first",
"lastActive": "2015-01-31T03:12:03.581Z",
"created": "2015-01-16T03:13:16.588Z",
"owner": "54b78f39ab48031b077e1f80"
}
]
Retrieve information about a room given its identifier :room
Parameter | Description |
---|---|
room | Room ID or slug |
GET /rooms/54d039092fbe9a8104ad9390
{
id: "54d039092fbe9a8104ad9390"
slug: "room1"
name: "Room 1"
description: "My Room #1"
lastActive: "2015-02-03T02:57:13.097Z"
created: "2015-02-03T02:57:13.097Z"
owner: "54c55225bbdccfca06cdd490"
}
Creates a new room.
Property | Description |
---|---|
name | Room name |
slug | Room slug |
description | Room description |
POST /rooms
{
"slug": "room1",
"name": "Room 1",
"description": "My Room #1"
}
201 Created
{
id: "54d039092fbe9a8104ad9390"
slug: "room1"
name: "Room 1"
description: "My Room #1"
lastActive: "2015-02-03T02:57:13.097Z"
created: "2015-02-03T02:57:13.097Z"
owner: "54c55225bbdccfca06cdd490"
}
Update the details of a room
Parameter | Description |
---|---|
room | Room ID or slug |
Property | Description |
---|---|
name | Room name |
description | Room description |
PUT /rooms/54d039092fbe9a8104ad9390
{
"name": "Room 1",
"description": "Your room"
}
200 OK
{
id: "54d039092fbe9a8104ad9390",
slug: "room1",
name: "Room 1",
description: "Your room",
lastActive: "2015-02-03T02:57:13.097Z",
created: "2015-02-03T02:57:13.097Z",
owner: "54c55225bbdccfca06cdd490"
}
Archives a room
Parameter | Description |
---|---|
room | Room ID or slug |
DELETE /rooms/54d039092fbe9a8104ad9390
204 No Content
Get the list of active users subscribed to a room
Parameter | Description |
---|---|
room | Room ID or slug |
GET /rooms/54d039092fbe9a8104ad9390/users
[
{
"id": "54c55225bbdccfca06cdd490",
"firstName": "John",
"lastName": "Smith",
"username": "john",
"displayName": "John Smith",
"avatar": "904f7d6c946702de92b9628d2c2caf9f",
"room": "54d039092fbe9a8104ad9390"
}
]