SupportChat
Get existing support chat
GET/api/public/chat/support
Headers
x-public-session-tokenrequiredstring | Public session token identifying the visitor (may alternatively be passed as the 'x-public-session-token' / 'ps_token' query parameter or, on secure connections, the 'X-PUBLIC-SESSION-TOKEN' cookie) |
Responses
default
Request
curl --request GET \
--url https://your-instance.iw-erp.de/api/public/chat/supportconst options = {method: 'GET'};
fetch('https://your-instance.iw-erp.de/api/public/chat/support', 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/public/chat/support"
response = requests.get(url)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-instance.iw-erp.de/api/public/chat/support');
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/public/chat/support"),
};
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/public/chat/support")
.get()
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/public/chat/support"
req, _ := http.NewRequest("GET", url, nil)
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/public_chatroom_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
final result = await PublicChatroomController.getSupport();
if (result.success) {
print(result.data);
}Start or get existing support chat
POST/api/public/chat/support
Headers
x-public-session-tokenrequiredstring | Public session token identifying the visitor (may alternatively be passed as the 'x-public-session-token' / 'ps_token' query parameter or, on secure connections, the 'X-PUBLIC-SESSION-TOKEN' cookie) |
Request body application/json
messagestringFirst message text
Responses
200Support chatroom created or retrievedobject
Show fields (4)
chatroomobjectparticipantobjectmessageobjectoffice_hoursobjectenabled, open, text (chatroom_support_office_hours_enabled)
Request
curl --request POST \
--url https://your-instance.iw-erp.de/api/public/chat/support \
--header 'content-type: application/json' \
--data '{"message":"string"}'const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: JSON.stringify({message: 'string'})
};
fetch('https://your-instance.iw-erp.de/api/public/chat/support', 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/public/chat/support"
payload = { "message": "string" }
headers = {"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/public/chat/support', [
'body' => '{"message":"string"}',
'headers' => [
'content-type' => 'application/json',
],
]);
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/public/chat/support"),
Content = new StringContent("{\"message\":\"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, "{\"message\":\"string\"}");
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/public/chat/support")
.post(body)
.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/public/chat/support"
payload := strings.NewReader("{\"message\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
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/public_chatroom_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
final result = await PublicChatroomController.postSupport('…');
if (result.success) {
print(result.data);
}Response 200 application/json
{}Get messages for support chat
GET/api/public/chat/message
Query parameters
chatroomrequiredstring | Chatroom notification token |
afterIdinteger | Load messages after this ID |
searchStringstring | text to search for in the list |
orderFieldNamestring | name of the order field |
orderFieldSortstring | sorting modeAllowed: DESCASC |
pageinteger | page of the list |
pageSizeinteger | number of entries for each page |
withMaxPageNumberstring | returns the number of pages available as a header if this is set |
Headers
x-public-session-tokenrequiredstring | Public session token identifying the visitor (may alternatively be passed as the 'x-public-session-token' / 'ps_token' query parameter or, on secure connections, the 'X-PUBLIC-SESSION-TOKEN' cookie) |
Responses
default
Request
curl --request GET \
--url 'https://your-instance.iw-erp.de/api/public/chat/message?chatroom=string'const options = {method: 'GET'};
fetch('https://your-instance.iw-erp.de/api/public/chat/message?chatroom=string', 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/public/chat/message?chatroom=string"
response = requests.get(url)
print(response.text)<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-instance.iw-erp.de/api/public/chat/message?chatroom=string');
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/public/chat/message?chatroom=string"),
};
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/public/chat/message?chatroom=string")
.get()
.build();
Response response = client.newCall(request).execute();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-instance.iw-erp.de/api/public/chat/message?chatroom=string"
req, _ := http.NewRequest("GET", url, nil)
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/public_chatroom_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
final result = await PublicChatroomController.getMessages(chatroomIdentifier: '…');
if (result.success) {
print(result.data);
}Send a message in existing support chat
POST/api/public/chat/message
Headers
x-public-session-tokenrequiredstring | Public session token identifying the visitor (may alternatively be passed as the 'x-public-session-token' / 'ps_token' query parameter or, on secure connections, the 'X-PUBLIC-SESSION-TOKEN' cookie) |
Request body application/json
chatroomstringChatroom notification token
messagestringMessage text
Responses
default
Request
curl --request POST \
--url https://your-instance.iw-erp.de/api/public/chat/message \
--header 'content-type: application/json' \
--data '
{
"chatroom": "string",
"message": "string"
}
'const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: JSON.stringify({chatroom: 'string', message: 'string'})
};
fetch('https://your-instance.iw-erp.de/api/public/chat/message', 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/public/chat/message"
payload = {
"chatroom": "string",
"message": "string"
}
headers = {"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/public/chat/message', [
'body' => '{"chatroom":"string","message":"string"}',
'headers' => [
'content-type' => 'application/json',
],
]);
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/public/chat/message"),
Content = new StringContent("{\"chatroom\":\"string\",\"message\":\"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, "{\"chatroom\":\"string\",\"message\":\"string\"}");
Request request = new Request.Builder()
.url("https://your-instance.iw-erp.de/api/public/chat/message")
.post(body)
.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/public/chat/message"
payload := strings.NewReader("{\"chatroom\":\"string\",\"message\":\"string\"}")
req, _ := http.NewRequest("POST", url, payload)
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/public_chatroom_controller.dart';
import 'package:iw_erp_api/logic/iw_api_state.dart';
IwApiState().host = 'your-instance.iw-erp.de';
final result = await PublicChatroomController.postMessage(chatroomIdentifier: '…', message: '…');
if (result.success) {
print(result.data);
}