A nanodjango app with a REST API for the creation and deletion of events in CalDAV calendars.
Go to file
Marc Koch 244c9f376e
display app version
2025-04-25 16:39:10 +02:00
.idea 🎉 Initial commit 2025-01-05 22:10:07 +01:00
src display app version 2025-04-25 16:39:10 +02:00
.gitignore 🎉 Initial commit 2025-01-05 22:10:07 +01:00
Dockerfile display app version 2025-04-25 16:39:10 +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 🎉 Initial commit 2025-01-05 22:10:07 +01:00
requirements.txt 🎉 Initial commit 2025-01-05 22:10:07 +01:00
version.txt display app version 2025-04-25 16:39:10 +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.