DT Backend

Status

[X] Not logged in

Login with Keycloak

API Documentation

Quick Endpoint Links

Menu API

GET /api/menu

POST /api/menu/selection

Note: This HTML form posts as application/x-www-form-urlencoded. The endpoint also accepts JSON.

Projects API

All requests use session authentication. CSRF is required for write operations (POST/PATCH/DELETE).

GET /api/projects/ (List)



        

POST /api/projects/ (Create)

Creates a project. Requires is_staff or is_superuser.


        

GET /api/projects/{id} (Retrieve)



        

PATCH /api/projects/{id} (Update)

Partial update. Requires is_staff or is_superuser.


        

DELETE /api/projects/{id} (Delete)


      

cURL Examples

Menus

curl -X GET "https://dt-backend.uwmh.eu/api/menu?projectId=1" -H "Accept: application/json"
curl -X POST "https://dt-backend.uwmh.eu/api/menu/selection" ^
  -H "Content-Type: application/json" ^
  -H "X-CSRFToken: <csrftoken_if_required>" ^
  --data "{ \"projectId\": 1, \"menuItemId\": 11 }"

Projects

# List
curl -X GET "https://dt-backend.uwmh.eu/api/projects/" -H "Accept: application/json"

# Create (staff/superuser)
curl -X POST "https://dt-backend.uwmh.eu/api/projects/" ^
  -H "Content-Type: application/json" ^
  -H "X-CSRFToken: <csrftoken>" ^
  --data "{ \"abbreviation\":\"ATLANTIS\",\"name\":\"ATLANTIS\",\"description\":\"...\",\"organisations\":[3,7] }"

# Retrieve
curl -X GET "https://dt-backend.uwmh.eu/api/projects/1/" -H "Accept: application/json"

# Patch (staff/superuser)
curl -X PATCH "https://dt-backend.uwmh.eu/api/projects/1/" ^
  -H "Content-Type: application/json" ^
  -H "X-CSRFToken: <csrftoken>" ^
  --data "{ \"description\": \"Updated\" }"

# Delete (staff/superuser)
curl -X DELETE "https://dt-backend.uwmh.eu/api/projects/1/" ^
  -H "X-CSRFToken: <csrftoken>"