summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/tools/wave/docs/rest-api/results-api/view.md
blob: 5b60d2ccf2e1dde0abdddc221e3d65c4fcc9b0cf (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Viewing Reports - [Results API](../README.md#results-api)

It is possible to view the reports generated by the WPT Report tool directly in the browser using a version of the report that is hosted by the WAVE server. The methods listed here return urls to those hosted reports.

## 1. `view report`

Returns a URL to a report for an API of a single session, generated by the WPT Report tool.

### HTTP Request

`GET /api/results/<session_token>/<api_name>/reporturl`

### Response Payload

```json
{
  "uri": "String"
}
```

### Example 

**Request:**

`GET /api/results/d9caaae0-c362-11e9-943f-eedb305f22f6/apiOne/reporturl`

**Response:**

```json
{
  "uri": "/results/d9caaae0-c362-11e9-943f-eedb305f22f6/apiOne/all.html"
}
```

## 2. `view multi report`

Returns a URL to a report for an API of multiple session, generated by the WPT Report tool.

### HTTP Request

`GET /api/results/<api_name>/reporturl`

### Query Parameters

| Parameter | Description                                                  | Default | Example                          |
| --------- | ------------------------------------------------------------ | ------- | -------------------------------- |
| `tokens`  | Comma separated list of tokens to create a multi report for. | none    | `tokens=token_a,token_b,token_c` |

### Example

**Request:**

`GET /api/results/apiOne/reporturl?tokens=ce2dc080-c283-11e9-b4d6-e046513784c2,cd922410-c344-11e9-858f-9063f6dd878f`

**Response:**

```json
{
  "uri": "/results/comparison-cd922410-ce2dc080-1709d631/apiOne/all.html"
}
```