# Who is online

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

With `ids`, whether each of those users is online, and when the others were last seen. Without it, a page of
the ids online now. Either way, how many are online across your app.

A user is online while any page or app of theirs is connected, and offline 10 seconds after the last one goes.

In the packages: `realtime.online.states( ids )`, `.has( id )`, `.count()` and `.list( { cursor, limit } )`.

## Parameters

| Name | In | |
|---|---|---|
| `ids` | query | Up to 1,000 user ids, comma separated. |
| `cursor` | query | Without `ids`, where the page starts, `0` for the first. |
| `limit` | query | Without `ids`, how many, 1,000 at most. |

## Answer

Who is online.

```json
{
  "ok": true,
  "count": 2,
  "online": [
    {
      "id": "42",
      "online": true
    },
    {
      "id": "99",
      "online": false,
      "at": 1791638400000
    }
  ]
}
```

## 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/online?ids=42,34'
```

**Node**

```js
const { online, count } = await wordplus('GET', '/wordplus/realtime/online?ids=42,34');
```

**Python**

```python
answer = wordplus("GET", "/wordplus/realtime/online?ids=42,34")
```

**PHP**

```php
$answer = wordplus('GET', '/wordplus/realtime/online?ids=42,34');
```

**Go**

```go
answer, err := app.Request("GET", "/wordplus/realtime/online?ids=42,34", nil)
```

