diff --git a/api/v1.md b/api/v1.md index 9e85bbb..9d94f4c 100644 --- a/api/v1.md +++ b/api/v1.md @@ -22,8 +22,6 @@ A "Bearer Token" is required to authenticate into the API, you can generate toke * 200: OK * 404: Result not found - - *** ### List results @@ -36,7 +34,7 @@ curl localhost/api/v1/results #### Filtering -You can filter the results response by the fields: `ping`, `download`, `upload`, `healthy`, `status`, `scheduled` and `created_at`. To filter on `created_at` use `start_at`and \`end\_at\`. +You can filter the results response by the fields: `ping`, `download`, `upload`, `healthy`, `status`, `scheduled` and `created_at`. To filter on `created_at` use `start_at`and `end_at`. Example: filter dates in a range @@ -77,8 +75,6 @@ curl localhost/api/v1/results?sort=-created_at * 200: OK * 422: Unprocessable Entity (validation probably failed, see logs) - - *** ### Get latest result @@ -94,8 +90,6 @@ curl localhost/api/v1/results/latest * 200: OK * 404: No result found - - *** ### Run speedtest @@ -118,10 +112,10 @@ curl -X POST localhost/api/v1/speedtests/run *** -### Stats +### Speedtest server list ```bash -curl localhost/api/v1/stats +curl -X POST localhost/api/v1/ookla/list-servers -H "Accept: application/json" -H "Authorization: Bearer yourtokengoeshere" ``` @@ -129,8 +123,21 @@ curl localhost/api/v1/stats #### Responses * 200: OK +* 403: Forbidden + +*** + +### Stats +```bash +curl localhost/api/v1/stats + -H "Accept: application/json" + -H "Authorization: Bearer yourtokengoeshere" +``` +#### Responses + +* 200: OK *** @@ -163,8 +170,6 @@ The data structure returned mimic the `results` table but includes the addition } ``` - - *** ### FAQ @@ -176,6 +181,3 @@ The data structure returned mimic the `results` table but includes the addition No, not at this time its read-only. - - -