# The rooms someone is in

`GET https://rest.wordplus.cloud/wordplus/realtime/rooms`

The rooms someone is in now, by name, with how many are in each: the members of a presence room, else its
connections. With `prefix`, only the rooms whose names start with it. A page has 100 rooms, or `limit` up to 1,000,
and `next` while there are more: send it back as `cursor`.

In the packages: `realtime.listRooms( { prefix, cursor, limit } )`.

## Parameters

| Name | In | |
|---|---|---|
| `prefix` | query | Only the rooms whose names start with it. |
| `cursor` | query | The `next` of the page before. |
| `limit` | query |  |

## Answer

The rooms, by name, and how many there are in all.

```json
{
  "ok": true,
  "count": 2,
  "rooms": [
    {
      "name": "order:42",
      "count": 1,
      "connections": 1
    },
    {
      "name": "order:43",
      "count": 2,
      "connections": 3
    }
  ]
}
```

## 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?prefix=order%3A'
```

**Node**

```js
const { rooms } = await wordplus('GET', '/wordplus/realtime/rooms?prefix=order%3A');
```

**Python**

```python
rooms = wordplus("GET", "/wordplus/realtime/rooms?prefix=order%3A")["rooms"]
```

**PHP**

```php
$rooms = wordplus('GET', '/wordplus/realtime/rooms?prefix=order%3A')['rooms'];
```

**Go**

```go
answer, err := app.Request("GET", "/wordplus/realtime/rooms?prefix=order%3A", nil)
```

