Skip to content
Developer

TrainerChatroom

Chat and notifications9 EndpointsChat / TrainerChatroom

Return the chatroom of an event as its trainer

GET/api/cp/chat/trainer/event/{eventIdentifier}

Path parameters

eventIdentifierrequiredstring

Responses

200Chatroom of the eventChatroom

Show fields (12)
  • unread_countinteger
  • is_unreadboolean
  • member_managedboolean

    Event- und freie Gruppenraeume verwalten Mitglieder bzw. Raum-Admins mit (verlassen, aufnehmen); Support-, Assistenten- und Fragebogen-Raeume nur die Verwaltung. Die Apps blenden danach die Raum-Optionen ein.

  • is_support_roomboolean

    Ist das der Haushalts-Chat mit dem Verein (Support-Chat)? Die Kunden-Apps sehen die Firma nicht und zeigen damit den Hinweis auf die Buerozeiten (chatroom_support_office_hours_enabled).

  • idinteger

    Primary key of the chat room. Internal ID.

  • notification_tokenstring

    Token used for notifications of the chat room.

  • trust_levelstring

    Berechnete Vertrauensstufe, siehe TRUST_LEVEL_*. Nur lesend nach aussen; gesetzt wird sie ausschliesslich vom ChatroomTrustLevelHelper.

  • member_started_typestring

    Von Mitgliedern gestartet (Paket D): "direct" (1:1, chatroom_member_direct_enabled) oder "group" (Gruppe eines Trainers, chatroom_trainer_groups_enabled); null fuer alle anderen Raeume.

  • handover_atstring (date-time)

    Seit wann die KI sich aus dem Raum zurueckgezogen hat. Solange das gesetzt ist, antwortet kein Profil-Bot mehr; der Raum wartet auf das Team. Gesetzt und geloescht nur vom ChatbotHandoverHelper.

  • handover_reasonstring

    Siehe HANDOVER_REASON_*.

  • namestring

    Name of the entity.

  • image_urlstring

    URL of the image of the entity.

Request
curl --request GET \
  --url https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42 \
  --header 'x-iw-jwt-token: <TOKEN>'
Response 200 application/json
{
  "id": 42,
  "name": "Beispiel",
  "image_url": "https://vynst.de",
  "unread_count": 1,
  "is_unread": true,
  "member_managed": true,
  "is_support_room": true,
  "notification_token": "string",
  "trust_level": "string",
  "member_started_type": "string"
}

Create (or return) the chatroom of an event as its trainer

POST/api/cp/chat/trainer/event/{eventIdentifier}

Requires trainerCanCreateChatroom on the event data type, and the logged in person has to be the performing person of the event.

Path parameters

eventIdentifierrequiredstring

Responses

200Chatroom of the eventChatroom

Show fields (12)
  • unread_countinteger
  • is_unreadboolean
  • member_managedboolean

    Event- und freie Gruppenraeume verwalten Mitglieder bzw. Raum-Admins mit (verlassen, aufnehmen); Support-, Assistenten- und Fragebogen-Raeume nur die Verwaltung. Die Apps blenden danach die Raum-Optionen ein.

  • is_support_roomboolean

    Ist das der Haushalts-Chat mit dem Verein (Support-Chat)? Die Kunden-Apps sehen die Firma nicht und zeigen damit den Hinweis auf die Buerozeiten (chatroom_support_office_hours_enabled).

  • idinteger

    Primary key of the chat room. Internal ID.

  • notification_tokenstring

    Token used for notifications of the chat room.

  • trust_levelstring

    Berechnete Vertrauensstufe, siehe TRUST_LEVEL_*. Nur lesend nach aussen; gesetzt wird sie ausschliesslich vom ChatroomTrustLevelHelper.

  • member_started_typestring

    Von Mitgliedern gestartet (Paket D): "direct" (1:1, chatroom_member_direct_enabled) oder "group" (Gruppe eines Trainers, chatroom_trainer_groups_enabled); null fuer alle anderen Raeume.

  • handover_atstring (date-time)

    Seit wann die KI sich aus dem Raum zurueckgezogen hat. Solange das gesetzt ist, antwortet kein Profil-Bot mehr; der Raum wartet auf das Team. Gesetzt und geloescht nur vom ChatbotHandoverHelper.

  • handover_reasonstring

    Siehe HANDOVER_REASON_*.

  • namestring

    Name of the entity.

  • image_urlstring

    URL of the image of the entity.

Request
curl --request POST \
  --url https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42 \
  --header 'x-iw-jwt-token: <TOKEN>'
Response 200 application/json
{
  "id": 42,
  "name": "Beispiel",
  "image_url": "https://vynst.de",
  "unread_count": 1,
  "is_unread": true,
  "member_managed": true,
  "is_support_room": true,
  "notification_token": "string",
  "trust_level": "string",
  "member_started_type": "string"
}

Grant or revoke write access for a participant of a chatroom you moderate

PUT/api/cp/chat/trainer/participant/{identifier}

Only room admins (the event trainers) and backend chat admins may call this. Room admins themselves keep their write access - a trainer cannot silence a co-trainer.

Path parameters

identifierrequiredstring

Request body application/json

  • dataChatroomParticipant
    Show fields (11)
    • idinteger

      Primary key of the participant. Internal ID.

    • participant_typestring

      Type of the participant.

    • first_namestring

      First name of the participant.

    • last_namestring

      Last name of the participant.

    • nicknamestring

      Nickname of the participant.

    • preferred_color_hexstring

      Preferred color of the participant as hex value.

    • avatar_tokenstring

      Token of the avatar image.

    • room_adminboolean

      A flag to indicate if this participant can delete messages in the chatroom + rename the chatroom + add or remove participants

    • can_writeboolean

      A flag to indicate if this participant can write messages

    • namestring

      Name of the entity.

    • image_urlstring

      URL of the image of the entity.

Responses

200The updated participantChatroomParticipant

Show fields (11)
  • idinteger

    Primary key of the participant. Internal ID.

  • participant_typestring

    Type of the participant.

  • first_namestring

    First name of the participant.

  • last_namestring

    Last name of the participant.

  • nicknamestring

    Nickname of the participant.

  • preferred_color_hexstring

    Preferred color of the participant as hex value.

  • avatar_tokenstring

    Token of the avatar image.

  • room_adminboolean

    A flag to indicate if this participant can delete messages in the chatroom + rename the chatroom + add or remove participants

  • can_writeboolean

    A flag to indicate if this participant can write messages

  • namestring

    Name of the entity.

  • image_urlstring

    URL of the image of the entity.

Request
curl --request PUT \
  --url https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42 \
  --header 'content-type: application/json' \
  --header 'x-iw-jwt-token: <TOKEN>' \
  --data '
{
  "data": {
    "id": 42,
    "first_name": "Lena",
    "last_name": "Hartmann",
    "name": "Beispiel",
    "image_url": "https://vynst.de",
    "participant_type": "string"
  }
}
'
Response 200 application/json
{
  "id": 42,
  "first_name": "Lena",
  "last_name": "Hartmann",
  "name": "Beispiel",
  "image_url": "https://vynst.de",
  "participant_type": "string",
  "nickname": "string",
  "preferred_color_hex": "string",
  "avatar_token": "string",
  "room_admin": true
}

Grant or revoke write access for a participant of a chatroom you moderate

PATCH/api/cp/chat/trainer/participant/{identifier}

Only room admins (the event trainers) and backend chat admins may call this. Room admins themselves keep their write access - a trainer cannot silence a co-trainer.

Path parameters

identifierrequiredstring

Request body application/json

  • dataChatroomParticipant
    Show fields (11)
    • idinteger

      Primary key of the participant. Internal ID.

    • participant_typestring

      Type of the participant.

    • first_namestring

      First name of the participant.

    • last_namestring

      Last name of the participant.

    • nicknamestring

      Nickname of the participant.

    • preferred_color_hexstring

      Preferred color of the participant as hex value.

    • avatar_tokenstring

      Token of the avatar image.

    • room_adminboolean

      A flag to indicate if this participant can delete messages in the chatroom + rename the chatroom + add or remove participants

    • can_writeboolean

      A flag to indicate if this participant can write messages

    • namestring

      Name of the entity.

    • image_urlstring

      URL of the image of the entity.

Responses

200The updated participantChatroomParticipant

Show fields (11)
  • idinteger

    Primary key of the participant. Internal ID.

  • participant_typestring

    Type of the participant.

  • first_namestring

    First name of the participant.

  • last_namestring

    Last name of the participant.

  • nicknamestring

    Nickname of the participant.

  • preferred_color_hexstring

    Preferred color of the participant as hex value.

  • avatar_tokenstring

    Token of the avatar image.

  • room_adminboolean

    A flag to indicate if this participant can delete messages in the chatroom + rename the chatroom + add or remove participants

  • can_writeboolean

    A flag to indicate if this participant can write messages

  • namestring

    Name of the entity.

  • image_urlstring

    URL of the image of the entity.

Request
curl --request PATCH \
  --url https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42 \
  --header 'content-type: application/json' \
  --header 'x-iw-jwt-token: <TOKEN>' \
  --data '
{
  "data": {
    "id": 42,
    "first_name": "Lena",
    "last_name": "Hartmann",
    "name": "Beispiel",
    "image_url": "https://vynst.de",
    "participant_type": "string"
  }
}
'
Response 200 application/json
{
  "id": 42,
  "first_name": "Lena",
  "last_name": "Hartmann",
  "name": "Beispiel",
  "image_url": "https://vynst.de",
  "participant_type": "string",
  "nickname": "string",
  "preferred_color_hex": "string",
  "avatar_token": "string",
  "room_admin": true
}

Remove a participant from a chatroom you moderate

DELETE/api/cp/chat/trainer/participant/{identifier}

Co-trainers (room admins) cannot be removed. The event sync does not add the person again. Requires chatroom_room_admin_manage_members_enabled.

Path parameters

identifierrequiredstring

Responses

200Removed

Request
curl --request DELETE \
  --url https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42 \
  --header 'x-iw-jwt-token: <TOKEN>'

Persons a room admin can (re-)add to the chatroom

GET/api/cp/chat/trainer/chatroom/{identifier}/candidates

Former participants and, for an event chat, persons signed up for the event who are not in the room. Requires chatroom_room_admin_manage_members_enabled.

Path parameters

identifierrequiredstring

Responses

200List of candidatesarray<object>

Show fields (4)
  • person_idinteger
  • first_namestring
  • last_namestring
  • reasonstring

    former | signed_up

Request
curl --request GET \
  --url https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/candidates \
  --header 'x-iw-jwt-token: <TOKEN>'
Response 200 application/json
[
  {
    "first_name": "Lena",
    "last_name": "Hartmann",
    "person_id": 42,
    "reason": "string"
  }
]

Add a person to a chatroom you moderate

POST/api/cp/chat/trainer/chatroom/{identifier}/participant

Only former participants and persons signed up for the event of the chatroom (see candidates). Requires chatroom_room_admin_manage_members_enabled.

Path parameters

identifierrequiredstring

Request body application/json

  • person_idinteger

Responses

200The added participantChatroomParticipant

Show fields (11)
  • idinteger

    Primary key of the participant. Internal ID.

  • participant_typestring

    Type of the participant.

  • first_namestring

    First name of the participant.

  • last_namestring

    Last name of the participant.

  • nicknamestring

    Nickname of the participant.

  • preferred_color_hexstring

    Preferred color of the participant as hex value.

  • avatar_tokenstring

    Token of the avatar image.

  • room_adminboolean

    A flag to indicate if this participant can delete messages in the chatroom + rename the chatroom + add or remove participants

  • can_writeboolean

    A flag to indicate if this participant can write messages

  • namestring

    Name of the entity.

  • image_urlstring

    URL of the image of the entity.

Request
curl --request POST \
  --url https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/participant \
  --header 'content-type: application/json' \
  --header 'x-iw-jwt-token: <TOKEN>' \
  --data '{"person_id":12}'
Response 200 application/json
{
  "id": 42,
  "first_name": "Lena",
  "last_name": "Hartmann",
  "name": "Beispiel",
  "image_url": "https://vynst.de",
  "participant_type": "string",
  "nickname": "string",
  "preferred_color_hex": "string",
  "avatar_token": "string",
  "room_admin": true
}

Rename a chatroom you moderate

PUT/api/cp/chat/trainer/chatroom/{identifier}

Requires chatroom_room_admin_manage_members_enabled.

Path parameters

identifierrequiredstring

Request body application/json

  • namestring

Responses

200The renamed chatroomChatroom

Show fields (12)
  • unread_countinteger
  • is_unreadboolean
  • member_managedboolean

    Event- und freie Gruppenraeume verwalten Mitglieder bzw. Raum-Admins mit (verlassen, aufnehmen); Support-, Assistenten- und Fragebogen-Raeume nur die Verwaltung. Die Apps blenden danach die Raum-Optionen ein.

  • is_support_roomboolean

    Ist das der Haushalts-Chat mit dem Verein (Support-Chat)? Die Kunden-Apps sehen die Firma nicht und zeigen damit den Hinweis auf die Buerozeiten (chatroom_support_office_hours_enabled).

  • idinteger

    Primary key of the chat room. Internal ID.

  • notification_tokenstring

    Token used for notifications of the chat room.

  • trust_levelstring

    Berechnete Vertrauensstufe, siehe TRUST_LEVEL_*. Nur lesend nach aussen; gesetzt wird sie ausschliesslich vom ChatroomTrustLevelHelper.

  • member_started_typestring

    Von Mitgliedern gestartet (Paket D): "direct" (1:1, chatroom_member_direct_enabled) oder "group" (Gruppe eines Trainers, chatroom_trainer_groups_enabled); null fuer alle anderen Raeume.

  • handover_atstring (date-time)

    Seit wann die KI sich aus dem Raum zurueckgezogen hat. Solange das gesetzt ist, antwortet kein Profil-Bot mehr; der Raum wartet auf das Team. Gesetzt und geloescht nur vom ChatbotHandoverHelper.

  • handover_reasonstring

    Siehe HANDOVER_REASON_*.

  • namestring

    Name of the entity.

  • image_urlstring

    URL of the image of the entity.

Request
curl --request PUT \
  --url https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42 \
  --header 'content-type: application/json' \
  --header 'x-iw-jwt-token: <TOKEN>' \
  --data '
{
  "name": "U12 Training"
}
'
Response 200 application/json
{
  "id": 42,
  "name": "Beispiel",
  "image_url": "https://vynst.de",
  "unread_count": 1,
  "is_unread": true,
  "member_managed": true,
  "is_support_room": true,
  "notification_token": "string",
  "trust_level": "string",
  "member_started_type": "string"
}

Rename a chatroom you moderate

PATCH/api/cp/chat/trainer/chatroom/{identifier}

Requires chatroom_room_admin_manage_members_enabled.

Path parameters

identifierrequiredstring

Request body application/json

  • namestring

Responses

200The renamed chatroomChatroom

Show fields (12)
  • unread_countinteger
  • is_unreadboolean
  • member_managedboolean

    Event- und freie Gruppenraeume verwalten Mitglieder bzw. Raum-Admins mit (verlassen, aufnehmen); Support-, Assistenten- und Fragebogen-Raeume nur die Verwaltung. Die Apps blenden danach die Raum-Optionen ein.

  • is_support_roomboolean

    Ist das der Haushalts-Chat mit dem Verein (Support-Chat)? Die Kunden-Apps sehen die Firma nicht und zeigen damit den Hinweis auf die Buerozeiten (chatroom_support_office_hours_enabled).

  • idinteger

    Primary key of the chat room. Internal ID.

  • notification_tokenstring

    Token used for notifications of the chat room.

  • trust_levelstring

    Berechnete Vertrauensstufe, siehe TRUST_LEVEL_*. Nur lesend nach aussen; gesetzt wird sie ausschliesslich vom ChatroomTrustLevelHelper.

  • member_started_typestring

    Von Mitgliedern gestartet (Paket D): "direct" (1:1, chatroom_member_direct_enabled) oder "group" (Gruppe eines Trainers, chatroom_trainer_groups_enabled); null fuer alle anderen Raeume.

  • handover_atstring (date-time)

    Seit wann die KI sich aus dem Raum zurueckgezogen hat. Solange das gesetzt ist, antwortet kein Profil-Bot mehr; der Raum wartet auf das Team. Gesetzt und geloescht nur vom ChatbotHandoverHelper.

  • handover_reasonstring

    Siehe HANDOVER_REASON_*.

  • namestring

    Name of the entity.

  • image_urlstring

    URL of the image of the entity.

Request
curl --request PATCH \
  --url https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42 \
  --header 'content-type: application/json' \
  --header 'x-iw-jwt-token: <TOKEN>' \
  --data '
{
  "name": "U12 Training"
}
'
Response 200 application/json
{
  "id": 42,
  "name": "Beispiel",
  "image_url": "https://vynst.de",
  "unread_count": 1,
  "is_unread": true,
  "member_managed": true,
  "is_support_room": true,
  "notification_token": "string",
  "trust_level": "string",
  "member_started_type": "string"
}