Debian Codegraph @

testing/web-platform/tests/tools/wave/docs/rest-api/devices-api/send-event.md

raw
1 # `send event` - [Devices API](../README.md#devices-api)
2
3 The `send event` method of the devices API enables sending an event to
4 listeners of specific devices events.
5
6 ## HTTP Request
7
8 `POST /api/devices/<device_token>/events`
9
10 ## Request Payload
11
12 ```json
13 {
14 "type": "<String>",
15 "data": "<Any>"
16 }
17 ```
18
19 - **type** defines what type of event has been triggered.
20 - **data** contains the event specific payload.
21
22 ## Event Types
23
24 See [device specific events](./event-types.md#device-specific)
25
26 ## Example
27
28 **Request:**
29
30 `POST /api/devices/1d9f5d30-830f-11ea-8dcb-0021ccd76152/events`
31
32 ```json
33 {
34 "type": "start_session",
35 "data": {
36 "session_token": "974c84e0-c35d-11e9-8f8d-47bb5bb0037d"
37 }
38 }
39 ```
40
41 **Response:**
42
43 `200 OK`