Save Chat Presence
using RestSharp;
var options = new RestClientOptions("http://localhost:56350/api/v1/Presence/SaveAll");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("[\n {\n \"UserId\": 123,\n \"DisplayName\": \"<string>\",\n \"OngoingChats\": 123,\n \"Present\": true,\n \"ChatTopics\": [\n 123\n ],\n \"TableRight\": {\n \"Mask\": \"<string>\",\n \"Reason\": \"<string>\"\n },\n \"FieldProperties\": {}\n }\n]", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
UserId: 123,
DisplayName: '<string>',
OngoingChats: 123,
Present: true,
ChatTopics: [123],
TableRight: {Mask: '<string>', Reason: '<string>'},
FieldProperties: {}
}
])
};
fetch('http://localhost:56350/api/v1/Presence/SaveAll', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "56350",
CURLOPT_URL => "http://localhost:56350/api/v1/Presence/SaveAll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'UserId' => 123,
'DisplayName' => '<string>',
'OngoingChats' => 123,
'Present' => true,
'ChatTopics' => [
123
],
'TableRight' => [
'Mask' => '<string>',
'Reason' => '<string>'
],
'FieldProperties' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "http://localhost:56350/api/v1/Presence/SaveAll"
payload = [
{
"UserId": 123,
"DisplayName": "<string>",
"OngoingChats": 123,
"Present": True,
"ChatTopics": [123],
"TableRight": {
"Mask": "<string>",
"Reason": "<string>"
},
"FieldProperties": {}
}
]
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
UserId: 123,
DisplayName: '<string>',
OngoingChats: 123,
Present: true,
ChatTopics: [123],
TableRight: {Mask: '<string>', Reason: '<string>'},
FieldProperties: {}
}
])
};
fetch('http://localhost:56350/api/v1/Presence/SaveAll', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Save Chat Presence
Save the chat presence for specified users
Save Chat Presence
using RestSharp;
var options = new RestClientOptions("http://localhost:56350/api/v1/Presence/SaveAll");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("[\n {\n \"UserId\": 123,\n \"DisplayName\": \"<string>\",\n \"OngoingChats\": 123,\n \"Present\": true,\n \"ChatTopics\": [\n 123\n ],\n \"TableRight\": {\n \"Mask\": \"<string>\",\n \"Reason\": \"<string>\"\n },\n \"FieldProperties\": {}\n }\n]", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
UserId: 123,
DisplayName: '<string>',
OngoingChats: 123,
Present: true,
ChatTopics: [123],
TableRight: {Mask: '<string>', Reason: '<string>'},
FieldProperties: {}
}
])
};
fetch('http://localhost:56350/api/v1/Presence/SaveAll', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "56350",
CURLOPT_URL => "http://localhost:56350/api/v1/Presence/SaveAll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'UserId' => 123,
'DisplayName' => '<string>',
'OngoingChats' => 123,
'Present' => true,
'ChatTopics' => [
123
],
'TableRight' => [
'Mask' => '<string>',
'Reason' => '<string>'
],
'FieldProperties' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "http://localhost:56350/api/v1/Presence/SaveAll"
payload = [
{
"UserId": 123,
"DisplayName": "<string>",
"OngoingChats": 123,
"Present": True,
"ChatTopics": [123],
"TableRight": {
"Mask": "<string>",
"Reason": "<string>"
},
"FieldProperties": {}
}
]
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
UserId: 123,
DisplayName: '<string>',
OngoingChats: 123,
Present: true,
ChatTopics: [123],
TableRight: {Mask: '<string>', Reason: '<string>'},
FieldProperties: {}
}
])
};
fetch('http://localhost:56350/api/v1/Presence/SaveAll', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Headers
The application token that identifies the partner app. Used when calling Online WebAPI from a server.
Body
application/jsontext/jsonapplication/xmltext/xmlapplication/x-www-form-urlencodedapplication/json-patch+jsonapplication/merge-patch+json
An array with ChatPresence objects. Only the UserId and Present information is used while saving
The id for the chat user
The display name of the chat user
The number of ongoing chats this users has now
Indicates if the user has the chat presence turned on or off
An array of ids with chat topics that this user is a member of
Wraps a table right together with an explanatory reason. Code can indicate why access is restricted.
Show child attributes
Show child attributes
Field property dictionary mapping field names to field access rights.
Show child attributes
Show child attributes
Response
204
No Content
Related topics
Save Chat PresenceNSChatAgentNSChatPresenceGet Chat PresenceNamespace CRMScript.NetServer⌘I