update api docs

This commit is contained in:
lesion
2022-03-11 23:18:33 +01:00
parent 4099aed395
commit 6bc65ae80c
2 changed files with 72 additions and 28 deletions

View File

@@ -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 ## Add a new event
POST POST
{: .label .label-orange} {: .label .label-orange}
**`/event`** **`/api/event`**
> info "info" > info "info"
> `Content-Type` has to be `multipart/form-data` to support image upload > `Content-Type` has to be `multipart/form-data` to support image upload
@@ -21,7 +45,6 @@ POST
| tags | `array` | List of tags | | tags | `array` | List of tags |
| recurrent | `object` | Recurrent event details | | recurrent | `object` | Recurrent event details |
| recurrent.frequency | `string` | could be `1w` or `2w` | | recurrent.frequency | `string` | could be `1w` or `2w` |
| recurrent.type | `string` | not used |
| recurrent.days | `array` | array of days | | recurrent.days | `array` | array of days |
| image | `image` | Image | | image | `image` | Image |

View File

@@ -10,15 +10,37 @@ nav_order: 8
1. TOC 1. TOC
{: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 ## Add a new event
POST POST
{: .label .label-orange} {: .label .label-orange}
**`/event`** **`/api/event`**
> info "info" > info "info"
> `Content-Type` has to be `multipart/form-data` to support image upload > `Content-Type` has to be `multipart/form-data` to support image upload
@@ -35,7 +57,6 @@ POST
| tags | `array` | List of tags | | tags | `array` | List of tags |
| recurrent | `object` | Recurrent event details | | recurrent | `object` | Recurrent event details |
| recurrent.frequency | `string` | could be `1w` or `2w` | | recurrent.frequency | `string` | could be `1w` or `2w` |
| recurrent.type | `string` | not used |
| recurrent.days | `array` | array of days | | recurrent.days | `array` | array of days |
| image | `image` | Image | | image | `image` | Image |