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_countintegeris_unreadbooleanmember_managedbooleanEvent- 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_roombooleanIst 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).
idintegerPrimary key of the chat room. Internal ID.
notification_tokenstringToken used for notifications of the chat room.
trust_levelstringBerechnete Vertrauensstufe, siehe TRUST_LEVEL_*. Nur lesend nach aussen; gesetzt wird sie ausschliesslich vom ChatroomTrustLevelHelper.
member_started_typestringVon 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_reasonstringSiehe HANDOVER_REASON_*.
namestringName of the entity.
image_urlstringURL of the image of the entity.
curl --request GET \
--url https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42 \
--header 'x-iw-jwt-token: <TOKEN>'const options = {method: 'GET', headers: {'x-iw-jwt-token': '<TOKEN>'}};
fetch('https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42"
headers = {"x-iw-jwt-token": "<TOKEN>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42', [
'headers' => [
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42")
.get()
.addHeader("x-iw-jwt-token", "<TOKEN>")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/trainer_chatroom_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await TrainerChatroomController.get('42');
if (result.success) {
print(result.data);
}{
"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_countintegeris_unreadbooleanmember_managedbooleanEvent- 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_roombooleanIst 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).
idintegerPrimary key of the chat room. Internal ID.
notification_tokenstringToken used for notifications of the chat room.
trust_levelstringBerechnete Vertrauensstufe, siehe TRUST_LEVEL_*. Nur lesend nach aussen; gesetzt wird sie ausschliesslich vom ChatroomTrustLevelHelper.
member_started_typestringVon 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_reasonstringSiehe HANDOVER_REASON_*.
namestringName of the entity.
image_urlstringURL of the image of the entity.
curl --request POST \
--url https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42 \
--header 'x-iw-jwt-token: <TOKEN>'const options = {method: 'POST', headers: {'x-iw-jwt-token': '<TOKEN>'}};
fetch('https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42"
headers = {"x-iw-jwt-token": "<TOKEN>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42', [
'headers' => [
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42")
.post(null)
.addHeader("x-iw-jwt-token", "<TOKEN>")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/cp/chat/trainer/event/42"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/trainer_chatroom_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await TrainerChatroomController.post('42');
if (result.success) {
print(result.data);
}{
"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
dataChatroomParticipantShow fields (11)
idintegerPrimary key of the participant. Internal ID.
participant_typestringType of the participant.
first_namestringFirst name of the participant.
last_namestringLast name of the participant.
nicknamestringNickname of the participant.
preferred_color_hexstringPreferred color of the participant as hex value.
avatar_tokenstringToken of the avatar image.
room_adminbooleanA flag to indicate if this participant can delete messages in the chatroom + rename the chatroom + add or remove participants
can_writebooleanA flag to indicate if this participant can write messages
namestringName of the entity.
image_urlstringURL of the image of the entity.
Responses
200The updated participantChatroomParticipant
Show fields (11)
idintegerPrimary key of the participant. Internal ID.
participant_typestringType of the participant.
first_namestringFirst name of the participant.
last_namestringLast name of the participant.
nicknamestringNickname of the participant.
preferred_color_hexstringPreferred color of the participant as hex value.
avatar_tokenstringToken of the avatar image.
room_adminbooleanA flag to indicate if this participant can delete messages in the chatroom + rename the chatroom + add or remove participants
can_writebooleanA flag to indicate if this participant can write messages
namestringName of the entity.
image_urlstringURL of the image of the entity.
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"
}
}
'const options = {
method: 'PUT',
headers: {'x-iw-jwt-token': '<TOKEN>', 'content-type': 'application/json'},
body: JSON.stringify({
data: {
id: 42,
first_name: 'Lena',
last_name: 'Hartmann',
name: 'Beispiel',
image_url: 'https://vynst.de',
participant_type: 'string'
}
})
};
fetch('https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42"
payload = { "data": {
"id": 42,
"first_name": "Lena",
"last_name": "Hartmann",
"name": "Beispiel",
"image_url": "https://vynst.de",
"participant_type": "string"
} }
headers = {
"x-iw-jwt-token": "<TOKEN>",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42', [
'body' => '{"data":{"id":42,"first_name":"Lena","last_name":"Hartmann","name":"Beispiel","image_url":"https://vynst.de","participant_type":"string"}}',
'headers' => [
'content-type' => 'application/json',
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
Content = new StringContent("{\"data\":{\"id\":42,\"first_name\":\"Lena\",\"last_name\":\"Hartmann\",\"name\":\"Beispiel\",\"image_url\":\"https://vynst.de\",\"participant_type\":\"string\"}}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"data\":{\"id\":42,\"first_name\":\"Lena\",\"last_name\":\"Hartmann\",\"name\":\"Beispiel\",\"image_url\":\"https://vynst.de\",\"participant_type\":\"string\"}}");
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42")
.put(body)
.addHeader("x-iw-jwt-token", "<TOKEN>")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42"
payload := strings.NewReader("{\"data\":{\"id\":42,\"first_name\":\"Lena\",\"last_name\":\"Hartmann\",\"name\":\"Beispiel\",\"image_url\":\"https://vynst.de\",\"participant_type\":\"string\"}}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/trainer_chatroom_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await TrainerChatroomController.putWriteAccess('42', true);
if (result.success) {
print(result.data);
}{
"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
dataChatroomParticipantShow fields (11)
idintegerPrimary key of the participant. Internal ID.
participant_typestringType of the participant.
first_namestringFirst name of the participant.
last_namestringLast name of the participant.
nicknamestringNickname of the participant.
preferred_color_hexstringPreferred color of the participant as hex value.
avatar_tokenstringToken of the avatar image.
room_adminbooleanA flag to indicate if this participant can delete messages in the chatroom + rename the chatroom + add or remove participants
can_writebooleanA flag to indicate if this participant can write messages
namestringName of the entity.
image_urlstringURL of the image of the entity.
Responses
200The updated participantChatroomParticipant
Show fields (11)
idintegerPrimary key of the participant. Internal ID.
participant_typestringType of the participant.
first_namestringFirst name of the participant.
last_namestringLast name of the participant.
nicknamestringNickname of the participant.
preferred_color_hexstringPreferred color of the participant as hex value.
avatar_tokenstringToken of the avatar image.
room_adminbooleanA flag to indicate if this participant can delete messages in the chatroom + rename the chatroom + add or remove participants
can_writebooleanA flag to indicate if this participant can write messages
namestringName of the entity.
image_urlstringURL of the image of the entity.
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"
}
}
'const options = {
method: 'PATCH',
headers: {'x-iw-jwt-token': '<TOKEN>', 'content-type': 'application/json'},
body: JSON.stringify({
data: {
id: 42,
first_name: 'Lena',
last_name: 'Hartmann',
name: 'Beispiel',
image_url: 'https://vynst.de',
participant_type: 'string'
}
})
};
fetch('https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42"
payload = { "data": {
"id": 42,
"first_name": "Lena",
"last_name": "Hartmann",
"name": "Beispiel",
"image_url": "https://vynst.de",
"participant_type": "string"
} }
headers = {
"x-iw-jwt-token": "<TOKEN>",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('PATCH', 'https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42', [
'body' => '{"data":{"id":42,"first_name":"Lena","last_name":"Hartmann","name":"Beispiel","image_url":"https://vynst.de","participant_type":"string"}}',
'headers' => [
'content-type' => 'application/json',
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
Content = new StringContent("{\"data\":{\"id\":42,\"first_name\":\"Lena\",\"last_name\":\"Hartmann\",\"name\":\"Beispiel\",\"image_url\":\"https://vynst.de\",\"participant_type\":\"string\"}}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"data\":{\"id\":42,\"first_name\":\"Lena\",\"last_name\":\"Hartmann\",\"name\":\"Beispiel\",\"image_url\":\"https://vynst.de\",\"participant_type\":\"string\"}}");
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42")
.patch(body)
.addHeader("x-iw-jwt-token", "<TOKEN>")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42"
payload := strings.NewReader("{\"data\":{\"id\":42,\"first_name\":\"Lena\",\"last_name\":\"Hartmann\",\"name\":\"Beispiel\",\"image_url\":\"https://vynst.de\",\"participant_type\":\"string\"}}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with package:http (no controller in the iw_erp_api package)
import 'dart:convert';
import 'package:http/http.dart' as http;
final response = await http.patch(
Uri.parse('https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42'),
headers: {'x-iw-jwt-token': '<TOKEN>', 'content-type': 'application/json'},
body: jsonEncode({
"data": {
"id": 42,
"first_name": "Lena",
"last_name": "Hartmann",
"name": "Beispiel",
"image_url": "https://vynst.de",
"participant_type": "string"
}
}),
);
print(response.body);{
"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
curl --request DELETE \
--url https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42 \
--header 'x-iw-jwt-token: <TOKEN>'const options = {method: 'DELETE', headers: {'x-iw-jwt-token': '<TOKEN>'}};
fetch('https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42"
headers = {"x-iw-jwt-token": "<TOKEN>"}
response = requests.delete(url, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42', [
'headers' => [
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42")
.delete(null)
.addHeader("x-iw-jwt-token", "<TOKEN>")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/cp/chat/trainer/participant/42"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/trainer_chatroom_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await TrainerChatroomController.removeParticipant('42');
if (result.success) {
print(result.data);
}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_idintegerfirst_namestringlast_namestringreasonstringformer | signed_up
curl --request GET \
--url https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/candidates \
--header 'x-iw-jwt-token: <TOKEN>'const options = {method: 'GET', headers: {'x-iw-jwt-token': '<TOKEN>'}};
fetch('https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/candidates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/candidates"
headers = {"x-iw-jwt-token": "<TOKEN>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/candidates', [
'headers' => [
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/candidates"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/candidates")
.get()
.addHeader("x-iw-jwt-token", "<TOKEN>")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/candidates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/trainer_chatroom_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await TrainerChatroomController.getCandidates('42');
if (result.success) {
print(result.data);
}[
{
"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)
idintegerPrimary key of the participant. Internal ID.
participant_typestringType of the participant.
first_namestringFirst name of the participant.
last_namestringLast name of the participant.
nicknamestringNickname of the participant.
preferred_color_hexstringPreferred color of the participant as hex value.
avatar_tokenstringToken of the avatar image.
room_adminbooleanA flag to indicate if this participant can delete messages in the chatroom + rename the chatroom + add or remove participants
can_writebooleanA flag to indicate if this participant can write messages
namestringName of the entity.
image_urlstringURL of the image of the entity.
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}'const options = {
method: 'POST',
headers: {'x-iw-jwt-token': '<TOKEN>', 'content-type': 'application/json'},
body: JSON.stringify({person_id: 12})
};
fetch('https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/participant', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/participant"
payload = { "person_id": 12 }
headers = {
"x-iw-jwt-token": "<TOKEN>",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/participant', [
'body' => '{"person_id":12}',
'headers' => [
'content-type' => 'application/json',
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/participant"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
Content = new StringContent("{\"person_id\":12}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"person_id\":12}");
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/participant")
.post(body)
.addHeader("x-iw-jwt-token", "<TOKEN>")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42/participant"
payload := strings.NewReader("{\"person_id\":12}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/trainer_chatroom_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await TrainerChatroomController.addParticipant('42', 42);
if (result.success) {
print(result.data);
}{
"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_countintegeris_unreadbooleanmember_managedbooleanEvent- 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_roombooleanIst 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).
idintegerPrimary key of the chat room. Internal ID.
notification_tokenstringToken used for notifications of the chat room.
trust_levelstringBerechnete Vertrauensstufe, siehe TRUST_LEVEL_*. Nur lesend nach aussen; gesetzt wird sie ausschliesslich vom ChatroomTrustLevelHelper.
member_started_typestringVon 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_reasonstringSiehe HANDOVER_REASON_*.
namestringName of the entity.
image_urlstringURL of the image of the entity.
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"
}
'const options = {
method: 'PUT',
headers: {'x-iw-jwt-token': '<TOKEN>', 'content-type': 'application/json'},
body: JSON.stringify({name: 'U12 Training'})
};
fetch('https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42"
payload = { "name": "U12 Training" }
headers = {
"x-iw-jwt-token": "<TOKEN>",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42', [
'body' => '{"name":"U12 Training"}',
'headers' => [
'content-type' => 'application/json',
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
Content = new StringContent("{\"name\":\"U12 Training\"}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"U12 Training\"}");
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42")
.put(body)
.addHeader("x-iw-jwt-token", "<TOKEN>")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42"
payload := strings.NewReader("{\"name\":\"U12 Training\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with the iw_erp_api package
import 'package:iw_erp_api/clients/trainer_chatroom_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
IwApiState().currentJwtApiToken = '<TOKEN>';
final result = await TrainerChatroomController.rename('42', '…');
if (result.success) {
print(result.data);
}{
"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_countintegeris_unreadbooleanmember_managedbooleanEvent- 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_roombooleanIst 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).
idintegerPrimary key of the chat room. Internal ID.
notification_tokenstringToken used for notifications of the chat room.
trust_levelstringBerechnete Vertrauensstufe, siehe TRUST_LEVEL_*. Nur lesend nach aussen; gesetzt wird sie ausschliesslich vom ChatroomTrustLevelHelper.
member_started_typestringVon 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_reasonstringSiehe HANDOVER_REASON_*.
namestringName of the entity.
image_urlstringURL of the image of the entity.
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"
}
'const options = {
method: 'PATCH',
headers: {'x-iw-jwt-token': '<TOKEN>', 'content-type': 'application/json'},
body: JSON.stringify({name: 'U12 Training'})
};
fetch('https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42"
payload = { "name": "U12 Training" }
headers = {
"x-iw-jwt-token": "<TOKEN>",
"content-type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('PATCH', 'https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42', [
'body' => '{"name":"U12 Training"}',
'headers' => [
'content-type' => 'application/json',
'x-iw-jwt-token' => '<TOKEN>',
],
]);
echo $response->getBody();using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42"),
Headers =
{
{ "x-iw-jwt-token", "<TOKEN>" },
},
Content = new StringContent("{\"name\":\"U12 Training\"}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"U12 Training\"}");
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42")
.patch(body)
.addHeader("x-iw-jwt-token", "<TOKEN>")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42"
payload := strings.NewReader("{\"name\":\"U12 Training\"}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-iw-jwt-token", "<TOKEN>")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Dart with package:http (no controller in the iw_erp_api package)
import 'dart:convert';
import 'package:http/http.dart' as http;
final response = await http.patch(
Uri.parse('https://your-instance.iw-erp.de/api/cp/chat/trainer/chatroom/42'),
headers: {'x-iw-jwt-token': '<TOKEN>', 'content-type': 'application/json'},
body: jsonEncode({
"name": "U12 Training"
}),
);
print(response.body);{
"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"
}