Skip to content
Developer

Trainer substitution

Events12 EndpointsEvent / Trainer substitution

Summary for the home widget and the menu badge: how many open appointments the person may take over, the next ones, and the own upcoming substitutions.

GET/api/event/trainer_substitution/summary

Query parameters

limitintegerEntries per list (default 3)

Responses

200enabled, in_pool, available_count, available (first entries), mine_upcoming_count, mine_upcoming (first entries)

Request
curl --request GET \
  --url https://your-instance.iw-erp.de/api/event/trainer_substitution/summary \
  --header 'x-iw-jwt-token: <TOKEN>'

Open appointments the logged-in trainer may take over now, by start.

GET/api/event/trainer_substitution/available

Query parameters

fromstring (date)
tostring (date)
eventinteger

Responses

200List of substitutions the person may take over

Request
curl --request GET \
  --url https://your-instance.iw-erp.de/api/event/trainer_substitution/available \
  --header 'x-iw-jwt-token: <TOKEN>'

Requested and taken over by the logged-in trainer.

GET/api/event/trainer_substitution/mine

Query parameters

pastbooleantrue = past ones, newest first

Responses

200Own substitutions

Request
curl --request GET \
  --url https://your-instance.iw-erp.de/api/event/trainer_substitution/mine \
  --header 'x-iw-jwt-token: <TOKEN>'

Take several appointments over at once (e.g. all open dates of one course). Each one is claimed on its own; the result lists success or the reasons per id.

POST/api/event/trainer_substitution/claim_multiple

Request body application/json

  • idsarray<integer>

Responses

200Per id: ok, state, reasons

Request
curl --request POST \
  --url https://your-instance.iw-erp.de/api/event/trainer_substitution/claim_multiple \
  --header 'content-type: application/json' \
  --header 'x-iw-jwt-token: <TOKEN>' \
  --data '{"ids":[1]}'

Own appointments the logged-in trainer released and that are still searching.

GET/api/event/trainer_substitution/released

Responses

200Own open releases

Request
curl --request GET \
  --url https://your-instance.iw-erp.de/api/event/trainer_substitution/released \
  --header 'x-iw-jwt-token: <TOKEN>'

Whether the logged-in trainer may release this own appointment for a substitute ("ich kann nicht"), or take an earlier release back.

GET/api/event/trainer_substitution/release_check/{bookingId}

Path parameters

bookingIdrequiredstring

Responses

200allowed, reasons, slot, deadline_hours and the own open release (substitution) if any

Request
curl --request GET \
  --url https://your-instance.iw-erp.de/api/event/trainer_substitution/release_check/42 \
  --header 'x-iw-jwt-token: <TOKEN>'

Release an own appointment for a substitute: the trainer is taken out of it and it is offered to the other trainers. Only for event types that allow it.

POST/api/event/trainer_substitution/release/{bookingId}

Path parameters

bookingIdrequiredstring

Request body application/json

  • notestring

Responses

200The opened substitution

Request
curl --request POST \
  --url https://your-instance.iw-erp.de/api/event/trainer_substitution/release/42 \
  --header 'content-type: application/json' \
  --header 'x-iw-jwt-token: <TOKEN>' \
  --data '{"note":"string"}'

Returns a single event trainer substitution entry.

GET/api/event/trainer_substitution/{id}

Path parameters

idrequiredstring

Responses

200One substitution with can_claim / reasons for the logged-in trainer

Request
curl --request GET \
  --url https://your-instance.iw-erp.de/api/event/trainer_substitution/42 \
  --header 'x-iw-jwt-token: <TOKEN>'

Whether the logged-in trainer may take the substitution over, and why not. Changes nothing.

POST/api/event/trainer_substitution/{id}/test

Path parameters

idrequiredstring

Responses

200eligible and reason codes

Request
curl --request POST \
  --url https://your-instance.iw-erp.de/api/event/trainer_substitution/42/test \
  --header 'x-iw-jwt-token: <TOKEN>'

Take the appointment over (DIRECT) or ask the office for it (APPROVAL). 400 with reason codes when the person may not, 409 when somebody else was faster.

POST/api/event/trainer_substitution/{id}/claim

Path parameters

idrequiredstring

Query parameters

lock_versionintegerlock_version of the displayed substitution

Responses

200The substitution after the claim

Request
curl --request POST \
  --url https://your-instance.iw-erp.de/api/event/trainer_substitution/42/claim \
  --header 'x-iw-jwt-token: <TOKEN>'

Take an own release back while nobody has requested or taken the appointment.

POST/api/event/trainer_substitution/{id}/take_back

Path parameters

idrequiredstring

Query parameters

lock_versioninteger

Responses

200The closed substitution

Request
curl --request POST \
  --url https://your-instance.iw-erp.de/api/event/trainer_substitution/42/take_back \
  --header 'x-iw-jwt-token: <TOKEN>'

Step back from a request, or from a taken over appointment before the deadline.

POST/api/event/trainer_substitution/{id}/withdraw

Path parameters

idrequiredstring

Query parameters

lock_versioninteger

Responses

200The substitution after stepping back

Request
curl --request POST \
  --url https://your-instance.iw-erp.de/api/event/trainer_substitution/42/withdraw \
  --header 'x-iw-jwt-token: <TOKEN>'