2020-03-23 16:38:43 +00:00
## API Documentation
___
> Values required in **`bold`**.
### **Accounts** | `account`
2020-03-31 17:42:44 +00:00
| field | data type | metadata |
| :-------------| :---------------- | :-------------------------- |
| id | unsigned integer | primary key, auto-increment |
| username | varchar | required |
| email | varchar | required |
| password | varchar | required |
| timezone | varchar | |
| earliest_time | varchar | |
| latest_time | varchar | |
| created_at | datetime | generated by database |
#### Add an account
2020-04-06 11:48:44 +00:00
**`POST /api/accounts`**
2020-03-23 16:38:43 +00:00
##### Request
2020-04-06 11:48:44 +00:00
A json object for the account to register with ** `username` **, ** `email` **, ** `password` **, `timezone` , `earliest_time` and `latest_time` .
2020-03-23 16:38:43 +00:00
```
{
2020-03-25 18:42:00 +00:00
"username": "jean",
2020-03-23 16:38:43 +00:00
"email": "jean@example.com",
"password": "really-strong-password",
"timezone": "Europe/Brussels",
"earliest_time":"09:30 AM",
"latest_time":"10:00 PM"
}
```
##### Response
2020-04-06 11:48:44 +00:00
A json object for the registered account with `id` , `username` , `email` , `timezone` , `earliest_time` and `latest_time` .
2020-03-23 16:38:43 +00:00
```
{
2020-03-23 17:02:50 +00:00
"status": 201,
"data": {
"id": 1,
"username": "jean",
"email": "jean@example.com",
"timezone": "Europe/Brussels",
"earliest_time":"09:30 AM",
"latest_time":"10:00 PM"l
}
2020-03-23 16:38:43 +00:00
}
```
2020-03-25 18:42:00 +00:00
#### Log in an account
2020-03-31 17:42:44 +00:00
**`POST /api/accounts/login`**
2020-03-25 18:42:00 +00:00
##### Request
2020-04-06 11:48:44 +00:00
A json object for the account to login with either ** `email` ** or ** `username` **, and ** `password` ** .
2020-03-25 18:42:00 +00:00
```
{
"username": "jean",
"password": "super-strong-password"
}
```
##### Response
2020-04-06 11:48:44 +00:00
A json object for the registered account with `id` , `username` , `email` , `timezone` , `earliest_time` and `latest_time` .
2020-03-25 18:42:00 +00:00
```
{
"status": 201,
"data": {
"id": 1,
"username": "jean",
"email": "jean@example.com",
"timezone": "Europe/Brussels",
"earliest_time":"09:30 AM",
"latest_time":"10:00 PM"l
}
}
```
2020-03-23 16:38:43 +00:00
#### Update an account
2020-03-31 17:42:44 +00:00
**`PUT /api/accounts/:id`**
2020-03-23 16:38:43 +00:00
##### Request
2020-04-06 11:48:44 +00:00
A json object for the account to register with `id` and any of `username` , `email` , `password` , `timezone` , `earliest_time` , `latest_time` .
2020-03-23 16:38:43 +00:00
```
{
"id": 15,
2020-03-25 18:42:00 +00:00
"earliest_time": "08:30 AM",
"latest_time": "08:00 PM"
2020-03-23 16:38:43 +00:00
}
```
##### Response
2020-04-06 11:48:44 +00:00
A json object for the registered account with `id` , `username` , `email` , `timezone` , `earliest_time` and `latest_time` .
2020-03-23 16:38:43 +00:00
```
{
2020-03-23 17:02:50 +00:00
"status": 200,
"data": {
"id": 1,
"username": "jean",
"email": "jean@example.com",
"timezone": "Europe/Brussels",
2020-03-25 18:42:00 +00:00
"earliest_time": "09:30 AM",
"latest_time": "10:00 PM"
2020-03-23 17:02:50 +00:00
}
2020-03-23 16:38:43 +00:00
}
```
#### Delete an account
2020-03-31 17:42:44 +00:00
**`DELETE /api/accounts/:id`**
2020-03-23 16:38:43 +00:00
##### Request
2020-04-06 11:48:44 +00:00
A json object for the account to delete with `id` .
2020-03-23 16:38:43 +00:00
```
{
"id": 15
}
```
##### Response
2020-04-06 11:48:44 +00:00
A json object for the deleted account with `username` and `email` .
2020-03-23 16:38:43 +00:00
```
{
2020-03-23 17:02:50 +00:00
"status": 200,
"data": {
"id": 15,
"username": "jean",
"email": "jean@example.com"
}
2020-03-23 16:38:43 +00:00
}
```
2020-03-31 17:42:44 +00:00
#### Get a list of meetings for an account
**`GET /api/accounts/:account_id/meetings`**
##### Request
A json object with an `account_id` .
```
{
"id": 5
}
```
##### Response
A json object for the specified account with an array of `meeting` .
```
{
"status": 200,
"data": [
{
"id": "worldwide-strategy-meeting-for-11059",
"title": "Worldwide strategy meeting for growth",
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
"start_time": 2022-02-16 20:00:00,
"timezone": "Europe/Brussels",
"duration": 60,
"status": 1
},
{
"id": "follow-up-with-tech-team-21850",
"title": "Follow up with tech team",
"duration": 120,
"status": 0
}
]
}
```
2020-03-25 18:42:00 +00:00
### **Meetings** | `meeting`
| field | data type | metadata |
| :---------- | :-------- | :-------------------------------------------------------------------------------- |
| id | varchar | primary key, first 30 chars of `title` with words separated by `-` + 5 random int |
| title | varchar | required |
| description | varchar | |
| start_time | datetime | |
| timezone | varchar | |
| duration | int | required |
| status | boolean | required: `0` (proposed) or `1` (confirmed) |
| password | varchar | |
| created_at | datetime | generated by database |
#### Add a meeting
2020-04-06 11:48:44 +00:00
**`POST /api/meetings`**
2020-03-23 16:38:43 +00:00
##### Request
2020-03-25 18:42:00 +00:00
A json object for the meeting to add with ** `id` **, ** `title` **, `description` , `start_time` , ** `duration` ** and `password` .
2020-03-23 16:38:43 +00:00
```
{
2020-03-25 18:42:00 +00:00
"id": "worldwide-strategy-meeting-for-11059",
"title": "Worldwide strategy meeting for growth",
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
"duration": 90,
"password": "generic-password"
2020-03-23 16:38:43 +00:00
}
```
##### Response
2020-03-25 18:42:00 +00:00
A json object for the added meeting with `id` , `title` , `description` , `start_time` , `duration` , `status` and `password` .
2020-03-23 16:38:43 +00:00
```
{
2020-03-23 17:02:50 +00:00
"status": 201,
"data": {
2020-03-25 18:42:00 +00:00
"id": "worldwide-strategy-meeting-for-11059",
"title": "Worldwide strategy meeting for growth",
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
"duration": 90,
"status": 0
}
}
```
2020-03-31 17:42:44 +00:00
#### Update a meeting
**`PUT /api/meetings/:id`**
##### Request
A json object for the meeting to update with `id` , `acount_id` and any of `title` , `description` , `start_time` , `timezone` , `duration` , `status` and `password` .
```
{
"id": "worldwide-strategy-meeting-for-11059",
"account_id": 5,
"start_time": 2022-02-16 20:00:00,
"timezone": "Europe/Brussels",
"status": 1
}
```
##### Response
A json object for the updated meeting with `id` , `title` , `description` , `start_time` , `timezone` , `duration` and `status` .
```
{
"status": 200,
"data": {
"id": "worldwide-strategy-meeting-for-11059",
"title": "Worldwide strategy meeting for growth",
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
"start_time": 2022-02-16 20:00:00,
"timezone": "Europe/Brussels",
"duration: 90,
"status": 1
}
}
```
#### Delete a meeting
**`DELETE /api/meetings/:id`**
##### Request
A json object for the meeting to delete with `id` and `account_id` .
```
{
"id": "worldwide-strategy-meeting-for-11059",
"account_id": 5
}
```
##### Response
2020-04-06 11:48:44 +00:00
A json object for the deleted meeting with `id` and `title` .
2020-03-31 17:42:44 +00:00
```
{
"status": 200,
"data": {
"id": "worldwide-strategy-meeting-for-11059",
"title": "Worldwide strategy meeting for growth",
}
}
```
2020-04-06 11:48:44 +00:00
#### Get a list of all participants for a meeting
**`GET /api/meetings/:id/participants`**
2020-03-25 18:42:00 +00:00
##### Request
A json object with an `account_id` .
```
{
2020-03-31 17:42:44 +00:00
"id": "worldwide-strategy-meeting-for-11059",
"account_id": 5
2020-03-25 18:42:00 +00:00
}
```
##### Response
2020-04-06 11:48:44 +00:00
A json object for the specified meeting with an array of `participant` .
2020-03-25 18:42:00 +00:00
```
{
"status": 200,
"data": [
{
2020-03-31 17:42:44 +00:00
"id": 23,
"account_id": 5,
"meeting_id": "worldwide-strategy-meeting-for-11059",
"earliest_time": "09:30 AM",
"latest_time": "05:00 PM",
"quorum": 1,
"mandatory": 1,
"host": 1,
"answered": 1,
"timezone": "Europe/Brussels"
2020-03-25 18:42:00 +00:00
},
{
2020-03-31 17:42:44 +00:00
"id": 28,
"account_id": 11,
"meeting_id": "worldwide-strategy-meeting-for-11059",
"earliest_time": "10:00 AM",
"latest_time": "09:00 PM",
"quorum": 0,
"mandatory": 1,
"host": 0,
"answered": 1,
"timezone": "Europe/Brussels"
2020-03-25 18:42:00 +00:00
}
]
}
```
2020-03-31 17:42:44 +00:00
### **Possible Dates** | `possible_date`
| field | data type | metadata |
| :------------ | :-------- | :-------------------------- |
| id | int | primary key, auto-increment |
| meeting_id | varchar | foreign key, required |
| possible_date | date | foreign key, required |
#### Add a possible date
**`POST /api/possible-dates`**
2020-03-25 18:42:00 +00:00
##### Request
2020-03-31 17:42:44 +00:00
A json object for the meeting to add with ** `meeting_id` ** and ** `possible_date` **.
```
{
"meeting_id": "worldwide-strategy-meeting-for-11059",
"possible_date": 2020-02-18
}
```
##### Response
A json object for the added meeting with `id` , `meeting_id` and `possible_date` .
```
{
"status": 201,
"data": {
"id": 5,
"meeting_id": "worldwide-strategy-meeting-for-11059",
"possible_date": 2020-02-18
}
}
```
#### Delete a possible date
**`DELETE /api/possible-dates/:id`**
##### Request
A json object for the possible date to delete with `id` and `account_id` .
```
{
"id": 12,
"account_id": 5
}
```
##### Response
A json object for the deleted possible date with `id` and `possible_date` .
```
{
"status": 200,
"data": {
"id": 15,
"possible_date": 2020-02-18
}
}
```
2020-04-06 11:48:44 +00:00
### **Participants** | `participant`
2020-03-31 17:42:44 +00:00
| field | data type | metadata |
| :------------ | :-------- | :-------------------------- |
| account_id | int | primary key, auto-increment |
| meeting_id | varchar | required |
| earliest_time | datetime | |
| latest_time | datetime | |
| quorum | boolean | `0` (no) or `1` (yes) |
| mandatory | boolean | `0` (no) or `1` (yes) |
| host | boolean | `0` (no) or `1` (yes) |
| answered | boolean | `0` (no) or `1` (yes) |
| timezone | varchar | required |
| created_at | datetime | generated by database |
2020-04-06 11:48:44 +00:00
#### Invite a participant
**`POST /api/participants`**
2020-03-31 17:42:44 +00:00
##### Request
2020-04-06 11:48:44 +00:00
A json object for the participant to add with ** `account_id` **, ** `meeting_id` **, ** `earliest_time` **, ** `latest_time` **, ** `quorum` **, ** `mandatory` **, ** `host` **, ** `answered` ** and ** `timezone` **.
2020-03-25 18:42:00 +00:00
```
{
"account_id": 5,
2020-03-31 17:42:44 +00:00
"meeting_id": "worldwide-strategy-meeting-for-11059",
"earliest_time": "08:30 AM",
"latest_time": "08:00 PM",
"quorum": 0,
"mandatory": 1,
"host": 0,
"answered": 0,
"timezone": "Europe/Brussels"
2020-03-25 18:42:00 +00:00
}
```
##### Response
2020-04-06 11:48:44 +00:00
A json object for the participant with `id` , `account_id` , `meeting_id` , `earliest_time` , `latest_time` , `quorum` , `mandatory` , `host` , `answered` and `timezone` .
2020-03-31 17:42:44 +00:00
```
{
"status": 201,
"data": {
"id": 23,
"account_id": 5,
"meeting_id": "worldwide-strategy-meeting-for-11059",
"earliest_time": "08:30 AM",
"latest_time": "08:00 PM",
"quorum": 0,
"mandatory": 1,
"host": 0,
"answered": 0,
"timezone": "Europe/Brussels"
}
}
```
2020-04-06 11:48:44 +00:00
#### Update a participant
**`PUT /api/participants/:id`**
2020-03-31 17:42:44 +00:00
##### Request
2020-04-06 11:48:44 +00:00
A json object for the participant to invite with `id` and any of `id` , `earliest_time` , `latest_time` , `quorum` , `mandatory` , `host` , `answered` and `timezone` .
2020-03-31 17:42:44 +00:00
```
{
"account_id": 5,
"earliest_time": "09:30 AM",
"latest_time": "05:00 PM",
"quorum": 1,
"host": 1,
"answered": 1,
}
```
##### Response
2020-04-06 11:48:44 +00:00
A json object for the participant with `id` , `account_id` , `meeting_id` , `earliest_time` , `latest_time` , `quorum` , `mandatory` , `host` , `answered` and `timezone` .
2020-03-25 18:42:00 +00:00
```
{
"status": 200,
"data": {
2020-03-31 17:42:44 +00:00
"id": 23,
"account_id": 5,
"meeting_id": "worldwide-strategy-meeting-for-11059",
"earliest_time": "09:30 AM",
"latest_time": "05:00 PM",
"quorum": 1,
"mandatory": 1,
"host": 1,
"answered": 1,
"timezone": "Europe/Brussels"
2020-03-25 18:42:00 +00:00
}
}
```
2020-04-06 11:48:44 +00:00
#### Delete a participant
**`DELETE /api/participants/:id`**
2020-03-25 18:42:00 +00:00
##### Request
2020-04-06 11:48:44 +00:00
A json object for the participant to delete with `id` .
2020-03-25 18:42:00 +00:00
```
{
2020-03-31 17:42:44 +00:00
"id": 23
2020-03-25 18:42:00 +00:00
}
```
##### Response
2020-04-06 11:48:44 +00:00
A json object for the deleted participant with `id` , `account_id` and `meeting_id` .
2020-03-25 18:42:00 +00:00
```
{
"status": 200,
"data": {
2020-03-31 17:42:44 +00:00
"id": 15,
"account_id": 5,
"meeting_id": "worldwide-strategy-meeting-for-11059"
2020-03-23 17:02:50 +00:00
}
2020-03-23 16:38:43 +00:00
}
2020-03-31 17:42:44 +00:00
```