# Ask to turn on a camera or microphone

`POST https://rest.wordplus.cloud/wordplus/realtime/calls/{name}/ask`

Asks someone in a group call to turn on their camera, microphone or both, for `by`, who asks: their page hears
it, and answers `by` alone. Nothing is kept. The same ask of the same person again within 30 seconds is refused
`asked_recently` (429), and someone not in the call `not_in_call` (404).

In the packages: `realtime.call( name ).ask( user, devices, by )`.

## Parameters

| Name | In | |
|---|---|---|
| `name` (required) | path | The group call name, percent-encoded: `meeting:7` is `meeting%3A7`. |

## Request

```json
{
  "user": "43",
  "devices": [
    "camera"
  ],
  "by": "42"
}
```

## Answer

The ask, with its id, which the answer names, and the devices asked.

```json
{
  "ok": true,
  "id": "k3v9x2",
  "devices": [
    "camera"
  ]
}
```

## 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.
- **404**: `not_in_call`: they are not in the call now.
- **429**: `asked_recently`: the same ask within 30 seconds.

## 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 POST '/wordplus/realtime/calls/meeting%3A7/ask' '{"user":"43","devices":["camera"],"by":"42"}'
```

**Node**

```js
const { id } = await wordplus('POST', `/wordplus/realtime/calls/${encodeURIComponent('meeting:7')}/ask`, { user: '43', devices: ['camera'], by: '42' });
```

**Python**

```python
ask = wordplus("POST", f"/wordplus/realtime/calls/{quote('meeting:7', safe='')}/ask", {"user": "43", "devices": ["camera"], "by": "42"})["id"]
```

**PHP**

```php
$id = wordplus('POST', '/wordplus/realtime/calls/'.rawurlencode('meeting:7').'/ask', ['user' => '43', 'devices' => ['camera'], 'by' => '42'])['id'];
```

**Go**

```go
answer, err := app.Request("POST", "/wordplus/realtime/calls/"+url.PathEscape("meeting:7")+"/ask", map[string]any{"user": "43", "devices": []string{"camera"}, "by": "42"})
```

