Debian Codegraph @

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

raw
1 # `read devices` - [Devices API](../README.md#devices-api)
2
3 The `read devices` method of the devices API fetches a list of all registered
4 devices.
5
6 ## HTTP Request
7
8 `GET /api/devices`
9
10 ## Response Payload
11
12 ```json
13 [
14 {
15 "token": "<String>",
16 "user_agent": "<String>",
17 "last_active": "<String>",
18 "name": "<String>"
19 },
20 ...
21 ]
22 ```
23
24 - **token** is the unique identifier of the device.
25 - **user_agent** is the user agent of the request the device was registered with.
26 - **last_active** defines the point in time the device was last active. Expressed as ISO 8601 date and time format.
27 - **name** the name the device was assign based on its user agent.
28
29 ## Example
30
31 **Request:**
32
33 `GET /api/devices`
34
35 **Response:**
36
37 ```json
38 [
39 {
40 "token": "1d9f5d30-830f-11ea-8dcb-0021ccd76152",
41 "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36",
42 "last_active": 1587391153295,
43 "name": "Chrome 81.0.4044"
44 },
45 ...
46 ]
47 ```