Skip to content

Draft: die-linke-app-frontend#107 Add Possibility to verifiy participants for events with token

This adds the endpoint api/v1/events/<event_id>/generate-invitation-token/ (which should just be called by coordinators/event owners), which returns something like:

{
  "data": {
    "token": "jcfC2Kxu8yH-LanTEK9KaKrRZw7oAOwskxIwdhGmwsI",
    "expires_at": "2025-12-02T13:33:46.350718+01:00"
  }
}

This token can then be use by /api/v1/events/validate-invitation-token/, therefore you need to pass the token inside a JSON body.

Curl example command
curl -X 'POST' \
  'http://localhost:8000/api/v1/events/validate-invitation-token/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-CSRFToken: cgAO2HQpefEMNHXMj5ZU2avh5ZN58MIAixczY6Il26Cj8Zj04RL1foJAtsbqRMfH' \
  -d '{
  "token": "jcfC2Kxu8yH-LanTEK9KaKrRZw7oAOwskxIwdhGmwsI"
}'

Which returns the existing/modiefied Event participation of the user, which looks something like this

{
  "data": {
    "id": 89,
    "user": 1,
    "is_verified": true,
    "is_pending_invitation": false,
    "event": 5,
    "user_is_member": true,
    "user_email": "admin@example.com",
    "user_username": "admin",
    "inviting_users": [
      1
    ],
    "assigned_event_areas": [],
    "is_team_captain": true,
    "is_event_coordinator": true
  }
}

Info

Since this requires a DB migration, you need to execute python manage.py migrate or docker:

docker-compose exec api python manage.py migrate

related: die-linke-app-frontend#107

Edited by control.alt.coop eG (Peter)

Merge request reports

Loading