Skip to content
Developer

CustomerChatroomMember

Chat and notifications8 EndpointsChat / CustomerChatroomMember

Persons the member may start a direct chat with

GET/api/cp/chat/contacts

Shared current, upcoming or recent event (chatroom_member_direct_via_event, on by default) or shared department (chatroom_member_direct_via_department), without blocked persons. Query q filters by name. Requires chatroom_member_direct_enabled (sonst 8618).

Query parameters

qstringPart of the name

Responses

200List of {person_id, name, reasons}

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

Get or start the direct chat with a person

POST/api/cp/chat/direct

Body: person (id). The same two persons always get the same room. Errors: 8618 off, 8621 no shared event/department, 8622 blocked, 8623 minor protection without parents on file. With minor protection a chat between an adult and a minor gets the minor's parents as readers.

Request body application/json

  • personinteger

Responses

200{id, token, name, member_started_type}

Request
curl --request POST \
  --url https://your-instance.iw-erp.de/api/cp/chat/direct \
  --header 'content-type: application/json' \
  --header 'x-iw-jwt-token: <TOKEN>' \
  --data '{"person":1}'

Persons a trainer may put into a group

GET/api/cp/chat/group_candidates

Signed-up (not waiting) and leading persons of the events the member leads (current, upcoming or recent). Requires chatroom_trainer_groups_enabled (sonst 8618); 8624 for members who lead no event.

Responses

200List of {person_id, name, reasons}

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

Start a group chat as trainer

POST/api/cp/chat/group

Body: name (1-100 characters), persons (ids from group_candidates, 1-100). The trainer is room admin. Errors: 8618 off, 8624 not a trainer, 8621 a person is not in the trainer's events.

Request body application/json

  • namestring
  • personsarray<integer>

Responses

200{id, token, name, member_started_type}

Request
curl --request POST \
  --url https://your-instance.iw-erp.de/api/cp/chat/group \
  --header 'content-type: application/json' \
  --header 'x-iw-jwt-token: <TOKEN>' \
  --data '
{
  "name": "Beispiel",
  "persons": [
    1
  ]
}
'

Report a chat message

POST/api/cp/chat/chatroom_message/{identifier}/report

Body: reason (optional, up to 1000 characters). The office sees the report in its queue (Chat, Meldungen). With chatroom_ai_moderation_enabled an unchecked message is checked by the AI moderation after the response. Only participants of the room report, not their own messages; a second report of the same person on the same message updates the open one. Requires chatroom_message_report_enabled (sonst 8618).

Path parameters

identifierrequiredstring

Request body application/json

  • reasonstring

Responses

200{id, status}

Request
curl --request POST \
  --url https://your-instance.iw-erp.de/api/cp/chat/chatroom_message/42/report \
  --header 'content-type: application/json' \
  --header 'x-iw-jwt-token: <TOKEN>' \
  --data '{"reason":"string"}'

The persons the member blocked

GET/api/cp/chat/blocks

Requires chatroom_block_enabled (sonst 8618).

Responses

200List of {id, person_id, name, created}

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

Block a person

POST/api/cp/chat/blocks

Body: person (id). No more direct chats in either direction, and the person's messages are hidden for the member in all rooms. Blocking twice keeps the first block. Requires chatroom_block_enabled (sonst 8618).

Request body application/json

  • personinteger

Responses

200{id, person_id, name, created}

Request
curl --request POST \
  --url https://your-instance.iw-erp.de/api/cp/chat/blocks \
  --header 'content-type: application/json' \
  --header 'x-iw-jwt-token: <TOKEN>' \
  --data '{"person":1}'

Unblock a person

DELETE/api/cp/chat/blocks/{identifier}

Path parameters

identifierrequiredstring

Responses

200{removed: bool}

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