summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/tools/wave/docs/rest-api/devices-api/read-devices.md
blob: 519b06c610d5e1d131c2c930d999f4c92f050deb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# `read devices` - [Devices API](../README.md#devices-api)

The `read devices` method of the devices API fetches a list of all registered 
devices.

## HTTP Request

`GET /api/devices`

## Response Payload

```json
[
  {
      "token": "<String>",
      "user_agent": "<String>",
      "last_active": "<String>",
      "name": "<String>"
  },
  ...
]
```

- **token** is the unique identifier of the device.
- **user_agent** is the user agent of the request the device was registered with.
- **last_active** defines the point in time the device was last active. Expressed as ISO 8601 date and time format.
- **name** the name the device was assign based on its user agent.

## Example

**Request:**

`GET /api/devices`

**Response:**

```json
[
  {
      "token": "1d9f5d30-830f-11ea-8dcb-0021ccd76152",
      "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36",
      "last_active": 1587391153295,
      "name": "Chrome 81.0.4044"
  },
  ...
]
```