From 6bc65ae80c5e737405aafb4cfb237331001e29d6 Mon Sep 17 00:00:00 2001 From: lesion Date: Fri, 11 Mar 2022 23:18:33 +0100 Subject: [PATCH] update api docs --- docs/.api.md | 51 +++++++++++++++++++++++++++++++++++-------------- docs/dev/api.md | 49 +++++++++++++++++++++++++++++++++-------------- 2 files changed, 72 insertions(+), 28 deletions(-) diff --git a/docs/.api.md b/docs/.api.md index 7c219609..25737f33 100644 --- a/docs/.api.md +++ b/docs/.api.md @@ -1,10 +1,34 @@ +## Get events + +GET +{: .label .label-green} + +**`/api/events`** + + + +**Params** + +| start | `integer` | start timestamp (default: now) | +| end | `integer` | end timestamp (optional) | +| tags | `array` | List of tags | +| places | `array` | List of places | +| max | `integer` | Max events | +| show_recurrent | `boolean` | Show also recurrent events (default: as choosen in admin settings) | + + +***Example*** +[https://demo.gancio.org/api/events](https://demo.gancio.org/api/events) +[usage example](https://framagit.org/les/gancio/-/blob/master/webcomponents/src/GancioEvents.svelte#L18-42) +--- + ## Add a new event POST {: .label .label-orange} -**`/event`** +**`/api/event`** > info "info" > `Content-Type` has to be `multipart/form-data` to support image upload @@ -21,7 +45,6 @@ POST | tags | `array` | List of tags | | recurrent | `object` | Recurrent event details | | recurrent.frequency | `string` | could be `1w` or `2w` | -| recurrent.type | `string` | not used | | recurrent.days | `array` | array of days | | image | `image` | Image | @@ -41,17 +64,17 @@ GET **Response** ```json -{ - "description" : null, - "recover_code" : "", - "id" : 1, - "createdAt" : "2020-01-29T18:10:16.630Z", - "updatedAt" : "2020-01-30T22:42:14.789Z", - "is_active" : true, - "settings" : "{}", - "email" : "eventi@cisti.org", - "is_admin" : true -} -``` + { + "description" : null, + "recover_code" : "", + "id" : 1, + "createdAt" : "2020-01-29T18:10:16.630Z", + "updatedAt" : "2020-01-30T22:42:14.789Z", + "is_active" : true, + "settings" : "{}", + "email" : "eventi@cisti.org", + "is_admin" : true + } + ``` --- diff --git a/docs/dev/api.md b/docs/dev/api.md index 3d3769b1..9062ff79 100644 --- a/docs/dev/api.md +++ b/docs/dev/api.md @@ -10,15 +10,37 @@ nav_order: 8 1. TOC {:toc} +## Get events + +GET +{: .label .label-green} + +**`/api/events`** +**Params** + +| start | `integer` | start timestamp (default: now) | +| end | `integer` | end timestamp (optional) | +| tags | `array` | List of tags | +| places | `array` | List of places | +| max | `integer` | Max events | +| show_recurrent | `boolean` | Show also recurrent events (default: as choosen in admin settings) | + + +***Example*** +[https://demo.gancio.org/api/events](https://demo.gancio.org/api/events) +[usage example](https://framagit.org/les/gancio/-/blob/master/webcomponents/src/GancioEvents.svelte#L18-42) + +--- + ## Add a new event POST {: .label .label-orange} -**`/event`** +**`/api/event`** > info "info" > `Content-Type` has to be `multipart/form-data` to support image upload @@ -35,7 +57,6 @@ POST | tags | `array` | List of tags | | recurrent | `object` | Recurrent event details | | recurrent.frequency | `string` | could be `1w` or `2w` | -| recurrent.type | `string` | not used | | recurrent.days | `array` | array of days | | image | `image` | Image | @@ -55,17 +76,17 @@ GET **Response** ```json -{ - "description" : null, - "recover_code" : "", - "id" : 1, - "createdAt" : "2020-01-29T18:10:16.630Z", - "updatedAt" : "2020-01-30T22:42:14.789Z", - "is_active" : true, - "settings" : "{}", - "email" : "eventi@cisti.org", - "is_admin" : true -} -``` + { + "description" : null, + "recover_code" : "", + "id" : 1, + "createdAt" : "2020-01-29T18:10:16.630Z", + "updatedAt" : "2020-01-30T22:42:14.789Z", + "is_active" : true, + "settings" : "{}", + "email" : "eventi@cisti.org", + "is_admin" : true + } + ``` ---