A nanodjango app with a REST API for the creation and deletion of events in CalDAV calendars.
Go to file
Marc Koch 07ddbb793e
🔧 configure application environment variables
Sets up environment variables within the docker-compose file,
replacing the use of a .env file. This includes defining
variables for Django secret key, allowed hosts, SMTP settings,
and sender name. This change improves configuration management
and clarifies the necessary environment settings.
2025-06-25 17:02:50 +02:00
.idea 🎉 Initial commit 2025-01-05 22:10:07 +01:00
src add automatic event overlap clearing 2025-06-25 17:01:52 +02:00
.gitignore 🎉 Initial commit 2025-01-05 22:10:07 +01:00
Dockerfile separate data from code 2025-04-25 17:06:49 +02:00
LICENSE.md 🎉 Initial commit 2025-01-05 22:10:07 +01:00
README.md 🎉 Initial commit 2025-01-05 22:10:07 +01:00
docker-compose.yaml 🔧 configure application environment variables 2025-06-25 17:02:50 +02:00
requirements.txt add automatic event overlap clearing 2025-06-25 17:01:52 +02:00
version.txt 🐛 show short event_id in description 2025-04-25 17:57:08 +02:00

README.md

Room Booking

This application allows you to create an event in a room booking calendar via a REST API.

Setup

If you see this page, the application is already running.

You will have to create users, API keys and calendars via admin interface.

Usage

A full documentation of the API is available at /api/docs/.

Authentication is done via a Bearer token in the Authorization header.

Create an event

To create an event, you need to send a POST request to /api/{calendar}/events/ with the following JSON payload:

{
  "name": "Event Title",
  "start": "2025-01-02T12:00:00",
  "end": "2025-01-02T13:00:00"
}

Curl example:

 curl -s \
   -H "Authorization: Bearer secrettoken" \
   -H "Content-Type: application/json" \
   -d "{\"name\": \"Test-Event\", \"start\": \"$(date --iso-8601=minutes)\", \"end\": \"$(date --iso-8601=minutes -d '+2 hours')\"}" \
   localhost:8000/api/test-kalender/event

The response will contain the event ID:

{"id": "4zx3QAFzoxV3vaZSKGaH2S"}

Delete an event

To delete an event, you need to send a DELETE request to /api/{calendar}/events/{event_id}.

Curl example:

curl -s -X DELETE \
  -H "Authorization: Bearer secrettoken" \
  -H "Content-Type: application/json" \
  localhost:8000/api/test-kalender/event/4zx3QAFzoxV3vaZSKGaH2S

The response will be empty but the status code will be 204.