Debian Codegraph @

testing/web-platform/tests/tools/wave/docs/rest-api/sessions-api/labels.md

raw
1 # `labels` - [Sessions API](../README.md#sessions-api)
2
3 The `labels` methods of the sessions API allow for better organization of sessions.
4
5 ## Read labels
6
7 Reads all labels of a session.
8
9 ### HTTP Request
10
11 `GET /api/sessions/<token>/labels`
12
13 ### Response Payload
14
15 ```json
16 "Array<String>"
17 ```
18
19 #### Example
20
21 **Request:**
22
23 `GET /api/sessions/afd4ecb0-c339-11e9-b66c-eca76c2bea9c/labels`
24
25 **Response:**
26
27 ```json
28 ["label1", "label2", "label3"]
29 ```
30
31 ## Update labels
32
33 Update all labels of a session.
34
35 ### HTTP Request
36
37 `PUT /api/sessions/<token>/labels`
38
39 ### Request Payload
40
41 ```json
42 "Array<String>"
43 ```
44
45 The array of labels provided in the request payload will replace all existing labels of the session.
46
47 #### Example
48
49 **Request:**
50
51 `GET /api/sessions/afd4ecb0-c339-11e9-b66c-eca76c2bea9c/labels`
52
53 **Response:**
54
55 ```json
56 ["label1", "label2", "label3"]
57 ```
58
59 **Request:**
60
61 `PUT /api/sessions/afd4ecb0-c339-11e9-b66c-eca76c2bea9c/labels`
62
63 ```json
64 ["label4", "label5"]
65 ```
66
67 **Request:**
68
69 `GET /api/sessions/afd4ecb0-c339-11e9-b66c-eca76c2bea9c/labels`
70
71 **Response:**
72
73 ```json
74 ["label4", "label5"]
75 ```