2020-04-14 11:49:10 +00:00
|
|
|
## API Documentation
|
2020-04-30 09:55:21 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2020-06-17 11:10:11 +00:00
|
|
|
**URL** https://meeting-planner-backend.herokuapp.com/
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
> Values required in **`bold`**.
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
### **Accounts** | `account`
|
|
|
|
|
|
|
|
| field | data type | metadata |
|
|
|
|
| :------------ | :--------------- | :-------------------------- |
|
|
|
|
| id | unsigned integer | primary key, auto-increment |
|
2020-08-26 11:14:52 +00:00
|
|
|
| username | string | required |
|
|
|
|
| email | string | required, unique |
|
|
|
|
| password | string | required |
|
|
|
|
| timezone | string | |
|
|
|
|
| earliest_time | string | |
|
|
|
|
| latest_time | string | |
|
2020-04-30 09:55:21 +00:00
|
|
|
| created_at | datetime | generated by database |
|
2020-05-02 19:08:24 +00:00
|
|
|
| updated_at | datetime | generated by database |
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
#### Add an account
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
**`POST /api/accounts`**
|
|
|
|
|
|
|
|
##### Request
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
A json object for the account to register with **`username`**, **`email`**, **`password`**, `timezone`, `earliest_time` and `latest_time`.
|
|
|
|
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"username": "jean",
|
|
|
|
"email": "jean@example.com",
|
|
|
|
"password": "really-strong-password",
|
|
|
|
"timezone": "Europe/Brussels",
|
2020-05-04 17:14:14 +00:00
|
|
|
"earliest_time":"09:30",
|
|
|
|
"latest_time":"22:00"
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `201`
|
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
A json object for the registered account with `id`, `username`, `email`, `timezone`, `earliest_time` and `latest_time`.
|
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-08-28 18:54:21 +00:00
|
|
|
"user": {
|
|
|
|
"id": 1,
|
|
|
|
"username": "jean",
|
|
|
|
"email": "jean@example.com",
|
|
|
|
"timezone": "Europe/Brussels",
|
|
|
|
"earliest_time":"09:30",
|
|
|
|
"latest_time":"22:00"
|
|
|
|
},
|
|
|
|
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1CJlbWFpbCI6ImphY2tAZXc2VybmFtZSI6ImphY2siLhhbXBsZS5jb20iLCJpYXQiOjE1OTg2MTc2MTksImV4cCI6MTYwMTIwOTYxOX0.s85ti_rzBVHJ6Gt1MY7seYfdcjB6sR939p2CexA40gI"
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Log in an account
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
**`POST /api/accounts/login`**
|
|
|
|
|
|
|
|
##### Request
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
A json object for the account to login with either **`email`** and **`password`** .
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-08-28 18:54:21 +00:00
|
|
|
"email": "jean@example.com",
|
|
|
|
"password": "password"
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `201`
|
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
A json object for the logged in account with `id`, `username`, `email`, `timezone`, `earliest_time`, `latest_time` and `token`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-08-28 18:54:21 +00:00
|
|
|
"user": {
|
|
|
|
"id": 1,
|
|
|
|
"username": "jean",
|
|
|
|
"email": "jean@example.com",
|
|
|
|
"timezone": "Europe/Brussels",
|
|
|
|
"earliest_time":"09:30",
|
|
|
|
"latest_time":"22:00"
|
|
|
|
},
|
|
|
|
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1CJlbWFpbCI6ImphY2tAZXc2VybmFtZSI6ImphY2siLhhbXBsZS5jb20iLCJpYXQiOjE1OTg2MTc2MTksImV4cCI6MTYwMTIwOTYxOX0.s85ti_rzBVHJ6Gt1MY7seYfdcjB6sR939p2CexA40gI"
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Update an account
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
**`PUT /api/accounts/:id`**
|
|
|
|
|
|
|
|
##### Request
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
A json object for the account to update with any of `username`, `email`, `password`, `timezone`, `earliest_time`, `latest_time`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-05-04 16:19:35 +00:00
|
|
|
"earliest_time": "08:30",
|
|
|
|
"latest_time": "20:00"
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `200`
|
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
A json object for the updated account with `id`, `username`, `email`, `timezone`, `earliest_time` and `latest_time`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-05-04 13:14:28 +00:00
|
|
|
"id": 1,
|
|
|
|
"username": "jean",
|
|
|
|
"email": "jean@example.com",
|
|
|
|
"timezone": "Europe/Brussels",
|
2020-05-04 17:14:14 +00:00
|
|
|
"earliest_time": "09:30",
|
|
|
|
"latest_time": "22:00"
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Delete an account
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
**`DELETE /api/accounts/:id`**
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `200`
|
|
|
|
|
2020-05-04 13:14:28 +00:00
|
|
|
A json object for the deleted account with confirmation message.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-05-04 13:14:28 +00:00
|
|
|
"message": "Account with id 15 successfully deleted."
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Get a list of meetings for an account
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-05-06 13:32:00 +00:00
|
|
|
**`GET /api/accounts/:id/meetings`**
|
2020-04-14 11:49:10 +00:00
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `200`
|
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
A json object for the specified account with an array of `meeting`.
|
|
|
|
|
|
|
|
```
|
2020-05-06 13:32:00 +00:00
|
|
|
[
|
|
|
|
{
|
|
|
|
"id": "03ac7a10-316f-46e8-bb55-8611e7e5b31c",
|
|
|
|
"title": "Worldwide meeting I",
|
|
|
|
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
|
2020-08-28 18:54:21 +00:00
|
|
|
"start_time": "2025-05-05T10:30:00Z",
|
2020-05-06 13:32:00 +00:00
|
|
|
"duration": 90,
|
2020-08-28 18:54:21 +00:00
|
|
|
"status": "false"
|
2020-05-06 13:32:00 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": "2e8f3748-ea5a-4d20-b9a8-683ac65f5634",
|
|
|
|
"title": "Worldwide meeting II",
|
|
|
|
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
|
2020-08-28 18:54:21 +00:00
|
|
|
"start_time": "2025-05-05T08:00:00Z",
|
2020-05-06 13:32:00 +00:00
|
|
|
"duration": 90,
|
2020-08-28 18:54:21 +00:00
|
|
|
"status": "false"
|
2020-05-06 13:32:00 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": "a8344a68-7961-4bff-bb3b-b288f3abcf1c",
|
|
|
|
"title": "Worldwide meeting III",
|
|
|
|
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
|
2020-08-28 18:54:21 +00:00
|
|
|
"start_time": "2025-05-05T14:30:00Z",
|
2020-05-06 13:32:00 +00:00
|
|
|
"duration": 90,
|
2020-08-28 18:54:21 +00:00
|
|
|
"status": "false"
|
2020-05-06 13:32:00 +00:00
|
|
|
}
|
2020-05-04 13:14:28 +00:00
|
|
|
]
|
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
```
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
### **Meetings** | `meeting`
|
|
|
|
|
|
|
|
| field | data type | metadata |
|
|
|
|
| :---------- | :-------- | :------------------------------------------ |
|
|
|
|
| id | uuid | primary key, auto-generated |
|
2020-08-26 11:14:52 +00:00
|
|
|
| title | string | required |
|
|
|
|
| description | string | |
|
2020-08-28 18:54:21 +00:00
|
|
|
| start_time | datetime | UTC Timestamp |
|
2020-04-30 09:55:21 +00:00
|
|
|
| duration | int | required |
|
|
|
|
| status | boolean | required: `0` (proposed) or `1` (confirmed) |
|
2020-08-26 11:14:52 +00:00
|
|
|
| password | string | |
|
2020-04-30 09:55:21 +00:00
|
|
|
| created_at | datetime | generated by database |
|
2020-05-02 19:08:24 +00:00
|
|
|
| updated_at | datetime | generated by database |
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
#### Add a meeting
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
**`POST /api/meetings`**
|
|
|
|
|
|
|
|
##### Request
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-08-26 11:14:52 +00:00
|
|
|
A json object for the meeting to add with **`title`**, `description`, `start_time`, **`duration`**, **status** and `password`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"title": "Worldwide strategy meeting for growth",
|
|
|
|
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
|
2020-08-28 18:54:21 +00:00
|
|
|
"start_time": "2025-05-05T10:00:00Z",
|
2020-04-14 11:49:10 +00:00
|
|
|
"duration": 90,
|
2020-08-28 18:54:21 +00:00
|
|
|
"status": 0
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `201`
|
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
A json object for the added meeting with `id`, `title`, `description`, `start_time`, `duration`, `status` and `password`.
|
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-05-04 13:36:16 +00:00
|
|
|
"id": "f86983db-955e-43b8-be3e-bc92bbeb9b43",
|
|
|
|
"title": "Worldwide strategy meeting for growth",
|
|
|
|
"description": "Let's find the best ethical growth hacking technics together. Yeah, fun.",
|
2020-08-28 18:54:21 +00:00
|
|
|
"start_time": "2025-05-05T10:00:00Z",
|
2020-05-04 13:36:16 +00:00
|
|
|
"duration": 90,
|
2020-08-28 18:54:21 +00:00
|
|
|
"status": 0
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Update a meeting
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
**`PUT /api/meetings/:id`**
|
|
|
|
|
|
|
|
##### Request
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-08-27 10:48:32 +00:00
|
|
|
A json object for the meeting to update with any of `title`, `description`, `start_time`, `duration`, `status` and `password`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-08-28 18:54:21 +00:00
|
|
|
"start_time": "2025-05-05T10:00:00Z",
|
2020-04-14 11:49:10 +00:00
|
|
|
"status": 1
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `200`
|
|
|
|
|
2020-08-27 10:48:32 +00:00
|
|
|
A json object for the updated meeting with `id`, `title`, `description`, `start_time`, `duration` and `status`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-05-04 14:03:39 +00:00
|
|
|
"id": "f86983db-955e-43b8-be3e-bc92bbeb9b43",
|
|
|
|
"title": "Worldwide strategy meeting for growth",
|
|
|
|
"description": "Let's find the best ethical growth hacking technics together.Yeah, fun.",
|
2020-08-28 18:54:21 +00:00
|
|
|
"start_time": "2025-05-05T10:00:00Z",
|
2020-05-04 14:03:39 +00:00
|
|
|
"duration: 90,
|
|
|
|
"status": 1
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Delete a meeting
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
**`DELETE /api/meetings/:id`**
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `200`
|
|
|
|
|
2020-05-05 09:24:16 +00:00
|
|
|
A json object for the deleted meeting with `message`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-05-05 14:13:12 +00:00
|
|
|
"message": "Meeting with id f86983db-955e-43b8-be3e-bc92bbeb9b43 was successfully deleted."
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
#### Get a list of all participants for a meeting
|
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
**`GET /api/meetings/:id/participants`**
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `200`
|
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
A json object for the specified meeting with an array of `participant`.
|
|
|
|
|
2020-05-05 09:24:16 +00:00
|
|
|
```
|
|
|
|
[
|
|
|
|
{
|
2020-08-28 18:54:21 +00:00
|
|
|
"id": "j8y9ta10-5g4f-46e8-bb55-8611e7e5bgtr",
|
|
|
|
"email": "liza@example.com",
|
2020-05-06 13:32:00 +00:00
|
|
|
"account_id": 1,
|
|
|
|
"meeting_id": "03ac7a10-316f-46e8-bb55-8611e7e5b31c",
|
2020-08-28 18:54:21 +00:00
|
|
|
"quorum": "false",
|
|
|
|
"mandatory": "false",
|
|
|
|
"host": "false",
|
|
|
|
"answered": "false"
|
2020-05-06 13:32:00 +00:00
|
|
|
},
|
|
|
|
{
|
2020-08-28 18:54:21 +00:00
|
|
|
"id": "gh59ta10-5g4f-46e8-bb55-8611e7eftg8t",
|
|
|
|
"email": "toni@example.com",
|
|
|
|
"account_id": 23,
|
2020-05-06 13:32:00 +00:00
|
|
|
"meeting_id": "03ac7a10-316f-46e8-bb55-8611e7e5b31c",
|
2020-08-28 18:54:21 +00:00
|
|
|
"quorum": "false",
|
|
|
|
"mandatory": "false",
|
|
|
|
"host": "false",
|
|
|
|
"answered": "false"
|
2020-05-06 13:32:00 +00:00
|
|
|
}
|
2020-05-05 09:24:16 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Get a list of all possible dates for a meeting
|
|
|
|
|
|
|
|
**`GET /api/meetings/:id/possible-dates`**
|
|
|
|
|
|
|
|
##### Response `200`
|
|
|
|
|
|
|
|
A json object for the specified meeting with an array of `possible_date`.
|
|
|
|
|
|
|
|
```
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"id": 12,
|
|
|
|
"meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43",
|
|
|
|
"possible_date": "2020-02-18"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 13,
|
|
|
|
"meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43",
|
|
|
|
"possible_date": "2020-02-19"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 14,
|
|
|
|
"meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43",
|
|
|
|
"possible_date": "2020-02-22"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
2020-06-02 14:54:13 +00:00
|
|
|
#### Get a list of all availability for a meeting
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-06-02 14:54:13 +00:00
|
|
|
**`GET /api/meetings/:id/availability`**
|
2020-04-14 11:49:10 +00:00
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `200`
|
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
A json object for the specified meeting with an array of `availability`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
2020-05-06 13:32:00 +00:00
|
|
|
[
|
|
|
|
{
|
|
|
|
"id": 1,
|
2020-08-28 18:54:21 +00:00
|
|
|
"participant_id": "gt537a10-316f-46e8-bb55-8611e7e5b31c",
|
2020-05-06 13:32:00 +00:00
|
|
|
"possible_date_id": 1,
|
|
|
|
"preference": false,
|
2020-08-28 18:54:21 +00:00
|
|
|
"start_time": "2025-05-05T09:00:00Z",
|
|
|
|
"end_time": "2025-05-05T22:00:00Z"
|
2020-05-06 13:32:00 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 2,
|
2020-08-28 18:54:21 +00:00
|
|
|
"participant_id": "7a103ac0-316f-46e8-bb55-8611eb31c7e5",
|
2020-05-06 13:32:00 +00:00
|
|
|
"possible_date_id": 1,
|
|
|
|
"preference": false,
|
2020-08-28 18:54:21 +00:00
|
|
|
"start_time": "2025-05-06T10:00:00Z",
|
|
|
|
"end_time": "2025-05-06T20:00:00Z"
|
2020-05-06 13:32:00 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 3,
|
2020-08-28 18:54:21 +00:00
|
|
|
"participant_id": "7a1003ac7a10-316f-46e8-bb55-8611e7e5b31c11e7e",
|
2020-05-06 13:32:00 +00:00
|
|
|
"possible_date_id": 2,
|
|
|
|
"preference": false,
|
2020-08-28 18:54:21 +00:00
|
|
|
"start_time": "2025-05-07T10:00:00Z",
|
|
|
|
"end_time": "2025-05-07T10:00:00Z"
|
2020-05-06 13:32:00 +00:00
|
|
|
}
|
|
|
|
]
|
2020-05-05 09:24:16 +00:00
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
```
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
### **Participants** | `participant`
|
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
| field | data type | metadata |
|
|
|
|
| :--------- | :-------- | :------------------------------ |
|
|
|
|
| id | uuid | required, primary key |
|
|
|
|
| email | string | |
|
|
|
|
| account_id | string | foreign key |
|
|
|
|
| meeting_id | string | required, foreign key |
|
|
|
|
| quorum | boolean | `0` (no) or `1` (yes) |
|
|
|
|
| mandatory | boolean | `0` (no) or `1` (yes) |
|
|
|
|
| host | boolean | required, `0` (no) or `1` (yes) |
|
|
|
|
| answered | boolean | required, `0` (no) or `1` (yes) |
|
|
|
|
| created_at | datetime | generated by database |
|
|
|
|
| updated_at | datetime | generated by database |
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
#### Invite a participant
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-04-14 11:49:10 +00:00
|
|
|
**`POST /api/participants`**
|
|
|
|
|
|
|
|
##### Request
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
A json object for the participant to add with `email`, `account_id`, **`meeting_id`**, `quorum`, `mandatory`, **`host`** and **`answered`**.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-08-28 18:54:21 +00:00
|
|
|
"email": "john@example.com",
|
2020-04-14 11:49:10 +00:00
|
|
|
"account_id": 5,
|
2020-04-30 09:55:21 +00:00
|
|
|
"meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43",
|
2020-04-14 11:49:10 +00:00
|
|
|
"quorum": 0,
|
|
|
|
"mandatory": 1,
|
|
|
|
"host": 0,
|
2020-08-28 18:54:21 +00:00
|
|
|
"answered": 0
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `201`
|
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
A json object for the added participant with `id`, `email`, `account_id`, `meeting_id`, `quorum`, `mandatory`, `host` and `answered`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-08-28 18:54:21 +00:00
|
|
|
"id": "983dbf86-955e-43b8-be3e-b9b43bc92bbe",
|
|
|
|
"email": "john@example.com",
|
2020-05-04 16:19:35 +00:00
|
|
|
"account_id": 5,
|
|
|
|
"meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43",
|
|
|
|
"quorum": 0,
|
|
|
|
"mandatory": 1,
|
|
|
|
"host": 0,
|
2020-08-28 18:54:21 +00:00
|
|
|
"answered": 0
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Update a participant
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
**`PUT /api/participants/:id`**
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
##### Request
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
A json object for the participant to update with any of `quorum`, `mandatory`, `host` and `answered`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"quorum": 1,
|
|
|
|
"host": 1,
|
2020-08-28 18:54:21 +00:00
|
|
|
"answered": 1
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `200`
|
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
A json object for the updated participant with `id`, `email`, `account_id`, `meeting_id`, `quorum`, `mandatory`, `host` and `answered`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-08-28 18:54:21 +00:00
|
|
|
"id": "983dbf86-955e-43b8-be3e-b9b43bc92bbe",
|
|
|
|
"email": "john@example.com",
|
2020-05-04 17:14:14 +00:00
|
|
|
"account_id": 5,
|
|
|
|
"meeting_id": "f86983db-955e-43b8-be3e-bc92bbeb9b43",
|
|
|
|
"quorum": 1,
|
|
|
|
"mandatory": 1,
|
|
|
|
"host": 1,
|
2020-08-28 18:54:21 +00:00
|
|
|
"answered": 1
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Delete a participant
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
**`DELETE /api/participants/:id`**
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
##### Response
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-05-05 09:24:16 +00:00
|
|
|
A json object for the deleted participant with `message`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-08-28 18:54:21 +00:00
|
|
|
"message": "Participant with id 983dbf86-955e-43b8-be3e-b9b43bc92bbe was successfully deleted."
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-05-02 19:08:24 +00:00
|
|
|
### **Possible Dates** | `possible_date`
|
|
|
|
|
|
|
|
| field | data type | metadata |
|
|
|
|
| :------------ | :-------- | :-------------------------- |
|
|
|
|
| id | int | primary key, auto-increment |
|
2020-08-26 11:14:52 +00:00
|
|
|
| meeting_id | string | foreign key, required |
|
2020-08-23 14:16:35 +00:00
|
|
|
| possible_date | string | required |
|
2020-05-02 19:08:24 +00:00
|
|
|
| created_at | datetime | generated by database |
|
|
|
|
| updated_at | datetime | generated by database |
|
|
|
|
|
|
|
|
#### Add a possible date
|
|
|
|
|
|
|
|
**`POST /api/possible-dates`**
|
|
|
|
|
|
|
|
##### Request
|
|
|
|
|
|
|
|
A json object for the meeting to add with **`meeting_id`** and **`possible_date`**.
|
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-05-06 13:32:00 +00:00
|
|
|
"meeting_id": "03ac7a10-316f-46e8-bb55-8611e7e5b31c",
|
|
|
|
"possible_date": "2025-02-27"
|
2020-05-02 19:08:24 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
##### Response `201`
|
|
|
|
|
|
|
|
A json object for the added meeting with `id`, `meeting_id` and `possible_date`.
|
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-05-06 13:32:00 +00:00
|
|
|
"id": 20,
|
|
|
|
"meeting_id": "03ac7a10-316f-46e8-bb55-8611e7e5b31c",
|
2020-08-23 14:17:08 +00:00
|
|
|
"possible_date": "2025-02-26"
|
2020-05-02 19:08:24 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Delete a possible date
|
|
|
|
|
|
|
|
**`DELETE /api/possible-dates/:id`**
|
|
|
|
|
|
|
|
##### Response `200`
|
|
|
|
|
2020-05-05 14:13:12 +00:00
|
|
|
A json object for the deleted possible date with `message`.
|
2020-05-02 19:08:24 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-05-05 14:13:12 +00:00
|
|
|
"message": "Possible date with id 12 was successfully deleted."
|
2020-05-02 19:08:24 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-06-02 14:54:13 +00:00
|
|
|
### **Availability** | `availability`
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
| field | data type | metadata |
|
|
|
|
| :--------------- | :-------- | :--------------------------------- |
|
|
|
|
| id | int | primary key, auto-increment |
|
|
|
|
| participant_id | int | foreign, required |
|
|
|
|
| possible_date_id | int | foreign key, required |
|
|
|
|
| preference | boolean | `0` (ideal) or `1` (yes), required |
|
|
|
|
| start_time | datetime | required, UTC timestamp |
|
|
|
|
| end_time | datetime | required, UTC timestamp |
|
|
|
|
| created_at | datetime | generated by database |
|
|
|
|
| updated_at | datetime | generated by database |
|
2020-04-14 11:49:10 +00:00
|
|
|
|
2020-06-02 14:54:13 +00:00
|
|
|
#### Add an availability
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-06-02 14:54:13 +00:00
|
|
|
**`POST /api/availability`**
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
##### Request
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
A json object with the availability to add with **`participant_id`**, **`possible_date_id`**, **`preference`**, **`start_time`** and **`end_time`**.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-08-28 18:54:21 +00:00
|
|
|
"participant_id": "03ac7a10-316f-46e8-bb55-8611e7e5b31c",
|
2020-05-06 13:32:00 +00:00
|
|
|
"possible_date_id": 1,
|
|
|
|
"preference": false,
|
2020-08-28 18:54:21 +00:00
|
|
|
"start_time": "2025-05-05T10:00:00Z",
|
|
|
|
"end_time": "2025-05-05T20:00:00Z"
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `201`
|
|
|
|
|
2020-08-28 18:54:21 +00:00
|
|
|
A json object with the availability added with `id`, `participant_id`, `possible_date_id`, `preference`, `start_time` and `end_time`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-05-06 13:32:00 +00:00
|
|
|
"id": 30,
|
2020-08-28 18:54:21 +00:00
|
|
|
"participant_id": "03ac7a10-316f-46e8-bb55-8611e7e5b31c",
|
2020-05-06 13:32:00 +00:00
|
|
|
"possible_date_id": 1,
|
|
|
|
"preference": false,
|
2020-08-28 18:54:21 +00:00
|
|
|
"start_time": "2025-05-05T10:00:00Z",
|
|
|
|
"end_time": "2025-05-05T20:00:00Z"
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-06-02 14:54:13 +00:00
|
|
|
#### Delete an availability
|
2020-04-30 09:55:21 +00:00
|
|
|
|
2020-06-02 14:54:13 +00:00
|
|
|
**`DELETE /api/availability/:id`**
|
2020-04-14 11:49:10 +00:00
|
|
|
|
2020-04-30 09:55:21 +00:00
|
|
|
##### Response `200`
|
|
|
|
|
2020-06-02 14:54:13 +00:00
|
|
|
A json object for the deleted availability with `message`.
|
2020-04-14 11:49:10 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{
|
2020-06-02 14:54:13 +00:00
|
|
|
"message": "Availability with id 30 was successfully deleted."
|
2020-04-14 11:49:10 +00:00
|
|
|
}
|
2020-04-14 12:03:55 +00:00
|
|
|
```
|