# A room and its members

`GET https://rest.wordplus.cloud/wordplus/realtime/rooms/{name}`

How many are in a room: the members of a presence room, else its connections. With `members=1`, the first
1,000 members of a presence room too, each with their info as your token gave it (sealed with the room key when
the room is sealed).

In the packages: `realtime.in( room ).count()` and `.members()`.

## Parameters

| Name | In | |
|---|---|---|
| `name` (required) | path | The room name, percent-encoded: `order:42` is `order%3A42`. |
| `members` | query | `1` to list the members. |

## Answer

The room.

```json
{
  "ok": true,
  "count": 2,
  "connections": 3,
  "members": {
    "count": 2,
    "list": [
      {
        "id": "34",
        "info": "ch:chat:34:42:1:1.AQEB…"
      },
      {
        "id": "42",
        "info": "ch:chat:34:42:1:1.AgIC…"
      }
    ]
  }
}
```

## Refusals

- **400**: `bad_request`, `bad_room`: the request is not one the API takes. `reserved`: an event name kept for the room itself.
- **401**: `missing_signature`, `stale_signature` (a clock off by more than 5 minutes), `unknown_site`, `bad_signature` (a wrong secret, or a body or path other than the one signed).
- **403**: `not_included`: your plan does not include it.

## Examples

`wordplus()` (in Go `app.Request()`) signs and sends the request: https://docs.wordplus.cloud/api/signing/ has it in each language.

**curl**

```bash
wordplus GET '/wordplus/realtime/rooms/chat%3A34%3A42?members=1'
```

**Node**

```js
const room = await wordplus('GET', `/wordplus/realtime/rooms/${encodeURIComponent('chat:34:42')}?members=1`);
```

**Python**

```python
from urllib.parse import quote
room = wordplus("GET", f"/wordplus/realtime/rooms/{quote('chat:34:42', safe='')}?members=1")
```

**PHP**

```php
$room = wordplus('GET', '/wordplus/realtime/rooms/'.rawurlencode('chat:34:42').'?members=1');
```

**Go**

```go
room, err := app.Request("GET", "/wordplus/realtime/rooms/"+url.PathEscape("chat:34:42")+"?members=1", nil)
```

