- create a user
- create a meeting in a user's calendar with a list of invited users
- get meeting details
- accept or decline another user's invitation
- find all user meetings for a given time range
- for a given list of users and a minimum meeting duration, find the nearest time interval in which all these users are free
Meetings in the calendar can have the following recurrence settings:
- no repeat
- every day
- every week
- every year
- Monday through Friday
To specify the server address, you can use the command line flag a
or the environment variable ADDRESS
. By default, 127.0.0.1:8080
.
The server accepts POST
and GET
requests with content-type application/json
.
POST
to /create-user
in the format
{
"info" : {
"name" : "Ivan"
}
}
200 OK
upon successful user addition400 Bad Request
upon request error404 Not Found
upon other errors
id of the created user
{
"id": "8c487d7a-a734-4c08-82f2-162c854ce827"
}
POST
to /create-event-with-users
in the format
{
"candidates" : ["8c487d7a-a734-4c08-82f2-162c854ce827"],
"participants" : ["c10ab64d-3860-46ef-bed6-46b8d3759928"],
"start" : "2022-09-02T10:00:05Z",
"finish" : "2022-09-02T11:00:05Z",
"repeat_type" : 0,
"info": {
"name": "Some meeting name"
}
}
where repeat_type
takes one of the following values depending on the type of repetition:
0
- no repeat1
- every day2
- every week3
- every year4
- Monday through Friday
200 OK
upon successful event addition to the calendar400 Bad Request
upon request error404 Not Found
upon other errors
id of the created event:
{
"id": "788dfa05-0f5d-4799-899a-c3b0e9eb3044"
}
GET
to /event-details
with the event id in the format
{
"event": "788dfa05-0f5d-4799-899a-c3b0e9eb3044"
}
200 OK
upon successful event existence and successful detail retrieval400 Bad Request
upon request error404 Not Found
upon other errors, including event absence
All information about the event:
{
"candidates" : ["8c487d7a-a734-4c08-82f2-162c854ce827"],
"participants" : ["c10ab64d-3860-46ef-bed6-46b8d3759928"],
"start" : "2022-09-02T10:00:05Z",
"finish" : "2022-09-02T11:00:05Z",
"repeat_type" : 0,
"info": {
"name": "Some meeting name"
}
}
POST
to /accept-invitation
with the user id and event id in the format
{
"user": "8c487d7a-a734-4c08-82f2-162c854ce827"
"event": "788dfa05-0f5d-4799-899a-c3b0e9eb3044"
}
200 OK
upon successful invitation acceptance400 Bad Request
upon request error404 Not Found
upon other errors
POST
to /reject-invitation
with the user id and event id in the format
{
"user": "8c487d7a-a734-4c08-82f2-162c854ce827"
"event": "788dfa05-0f5d-4799-899a-c3b0e9eb3044"
}
200 OK
upon successful invitation rejection400 Bad Request
upon request error404 Not Found
upon other errors
GET
to /events
with the user id and time interval in the format
{
"user" : "8c487d7a-a734-4c08-82f2-162c854ce827",
"from" : "2022-09-02T10:00:05Z",
"to" : "2022-09-02T11:00:05Z",
}
200 OK
upon successful event retrieval400 Bad Request
upon request error404 Not Found
upon other errors
All information about events intersecting with the specified interval:
{
[
{
"id" : "375d9831-592c-4373-8398-e22a54eaff2c"
"candidates" : [],
"participants" : ["c10ab64d-3860-46ef-bed6-46b8d3759928"],
"start" : "2022-09-02T10:00:05Z",
"finish" : "2022-09-02T11:00:05Z",
"repeat_type" : 0,
"info": {
"name": "Some meeting name 1"
}
},
{
"id" : "36492a24-24ba-478b-90b4-583486123291"
"candidates" : ["87bbd840-a07a-4ef2-9407-09523695f690"],
"participants" : ["ce48717b-ec68-4dfd-8917-fe59c8724b7e"],
"start" : "2022-09-02T10:00:05Z",
"finish" : "2022-09-02T11:00:05Z",
"repeat_type" : 1,
"info": {
"name": "Some meeting name 2"
}
}
]
}
GET
to /find-slot
with user ids, meeting duration in nanoseconds, and time after which the search for a meeting is no longer needed
{
"users" : [
"8c487d7a-a734-4c08-82f2-162c854ce827",
"375d9831-592c-4373-8398-e22a54eaff2c"
],
"duration" : 1800000000000,
"valid_until" : "2022-10-02T11:00:00Z",
}
200 OK
upon successful slot identification400 Bad Request
upon request error404 Not Found
upon other errors
Successful response format:
{
"begin": "2022-09-05T11:00:00Z"
}
- Add tests
- Add database support