This capitol represents all models.
All models used in the Open Calendar API are represented as JSON-objects.
This object represents user.
Field | Type | Description |
---|---|---|
String | User's mail | |
first_name | String | User's first name |
last_name | String | User's last name |
google_mail | String | Optional. User's google mail. If logged via Google Auth |
google_id | String | Optional. User's google id. If logged via Google Auth |
Example of Mail user:
{
"mail": "[email protected]",
"first_name": "Jon",
"last_name": "Snow"
}
Example of Google user:
{
"google_id": "420775159475",
"google_mail": "[email protected]",
"first_name": "Daenerys",
"last_name": "Targaryen"
}
Example of Anonymous User:
{
"mail": "anonymous"
}
This object represents calendar.
Field | Type | Description |
---|---|---|
title | String | Calendar's title |
creator | String | Mail of the creator of calendar |
timezone | Timezone | Calendar's timezone |
type | Boolean | Type of calendar. True if public or False is private |
members | Array of User | Members of this calendar |
events | Array of Event | Events in this calendars |
*Members of group have the same rights as creator, except they cannot delete the calendar
Example of Calendar
{
"title": "Lessons",
"creator": "[email protected]",
"timezone": "Europe/Prague",
"type": true,
"members": [
{
"mail": "[email protected]",
"first_name": "Jon",
"last_name": "Snow"
}
],
"events": []
}
This object represents event.
Field | Type | Description |
---|---|---|
title | String | Event's title |
start | Date | Start of event |
end | Date | End of event |
color | String | Optional. Color of event - hash(#00ff00) or word(green) |
notes | Array of Note | Optional. Notes of event |
repeat | String | Optional. Can be "day","week","month","year" or empty string. |
This capitol represents all methods to interact with models.
GET /auth/google/login
- login via Google Auth
GET /auth/logout
- logout from Google account
GET /auth/mail/login
- login via Mail
GET /auth/logout
- logout from Mail account
GET /api/user
- return current logged User
GET /api/user/{id}
- return user by given id
PUT /api/user
- change user first or last name. Must be logged in
GET /api/calendar
- return array of all calendars of signed User. In case of anonymous user, returns empty array
GET /api/calendar/{id}
- return the calendar based on id
POST /api/calendar
- create new calendar
PUT /api/calendar/{id}
- update existed calendar by id
DELETE /api/calendar/{id}
- delete existed calendar by id
GET /api/event/{id}
- return array of events in calendar found by id of calendar
POST /api/event/{id}
- create event in the calendar found by id of calendar
PUT /api/event/{id}/{event_id}
- update existing event by id of calendar and event_id
DELETE /api/event/{id}/{event_id}
- delete existing event by id of calendar and event
You can invite/ban people to your calendar by RESTing:
POST /api/invite/{id}/{mail}
- where id is id of calendar
As far as Open Calendar using moment.js all timezones are taken from IANA list of timezone
You can only create 5 calendars from one IP in 1 hour, then you start catching error.