Skip to content

Commit 81624bc

Browse files
authored
Final changes, #PG-5170 (#47)
* change parameter examples * Cleaning up for marketplace & changing readme
1 parent c1c55c3 commit 81624bc

8 files changed

Lines changed: 20 additions & 5 deletions

File tree

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The API Reference plugin improves API discoverability while supporting modern AP
2020
Navigate to:
2121

2222
```text
23-
Administration → System → SwaggerUI
23+
Administration → System → API
2424
```
2525

2626
The Swagger UI page will display API documentation for installed plugins.
@@ -37,6 +37,22 @@ To manually regenerate specifications:
3737

3838
This is useful after installing, enabling, or updating plugins.
3939

40+
**NOTE:** The initial generation process may take some time to complete, depending on the number of installed plugins.
41+
42+
## Read Specs Via the Reporting API
43+
44+
This plugin exposes a Reporting API method for reading generated OpenAPI specs directly.
45+
46+
To read a previously generated spec for a plugin:
47+
48+
```text
49+
index.php?module=API&method=ApiReference.getOpenApiSpec&pluginName=Login&format=json
50+
```
51+
52+
This returns the JSON spec file for the requested plugin.
53+
54+
If you are calling these endpoints outside the Matomo UI, include your usual authentication parameters such as `token_auth`.
55+
4056
## Authorise API Requests
4157

4258
To test API endpoints from Swagger UI:

config/ParameterExamples.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
'segmentName:string' => 'New Zealand visitors',
1818
'idSite:int' => 1,
1919
'idExperiment:int' => 1,
20-
'successMetric:string' => 'conversion_rate',
21-
'name:string' => 'Pricing page signup test',
20+
'successMetric:string' => 'nb_visits',
21+
'name:string' => 'Pricing',
2222
'hypothesis:string' => 'A shorter signup flow will improve conversions.',
2323
'description:string' => 'Compare the pricing page signup experience for New Zealand traffic.',
2424
'variations:array<int,array<string,mixed>>' => [
@@ -95,7 +95,6 @@
9595
'metricIds:string[]' => [
9696
'nb_visits',
9797
'nb_conversions',
98-
'conversion_rate',
9998
],
10099
'idSubtable:int|string|false' => 1,
101100
'login:string' => 'alice',

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
## Documentation
22

3-
The [ApiReference User Guide](https://matomo.org/faq/how-to/PLACEHOLDER) and the [README.md](https://github.com/matomo-org/plugin-ApiReference/blob/5.x-dev/README.md#features) cover how to get the most out of this plugin.
3+
The [ApiReference User Guide](https://matomo.org/faq/how-to/how-to-use-the-api-reference-in-matomo) and the [README.md](https://github.com/matomo-org/plugin-ApiReference/blob/5.x-dev/README.md#features) cover how to get the most out of this plugin.

screenshots/0_Swagger_page.png

133 KB
Loading

screenshots/1_Token_auth.png

89.1 KB
Loading

screenshots/2_Try_it_out.png

71.6 KB
Loading

screenshots/3_Parameter_values.png

64.5 KB
Loading

screenshots/4_API_response.png

108 KB
Loading

0 commit comments

Comments
 (0)