Apply user availability status
curl --request PUT \
--url http://localhost:8080/availability-statuses/users/{user_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "http://localhost:8080/availability-statuses/users/{user_id}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('http://localhost:8080/availability-statuses/users/{user_id}', 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 => "8080",
CURLOPT_URL => "http://localhost:8080/availability-statuses/users/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/availability-statuses/users/{user_id}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <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))
}HttpResponse<String> response = Unirest.put("http://localhost:8080/availability-statuses/users/{user_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/availability-statuses/users/{user_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"availability": {
"id": "<string>",
"user_id": 123,
"organization_id": "<string>",
"is_available": true,
"custom_status": "<string>",
"last_status_change": "2023-11-07T05:31:56Z",
"current_chat_count": 123,
"max_concurrent_chats": 123,
"notes": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"call_available": true,
"call_locked": true,
"call_wrap_up_until": "2023-11-07T05:31:56Z",
"call_wrap_up_phone_call_id": "<string>",
"availability_status_id": "<string>",
"call_wrap_up_started_at": "2023-11-07T05:31:56Z"
},
"resolved_status": {
"kind": "custom",
"status_id": "<string>",
"name": "<string>",
"availability_type": "offline",
"color": "blue"
},
"teams": [
{
"id": "<string>",
"name": "<string>",
"available": true
}
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Availability Statuses
Apply user availability status
Apply a defined availability status (status_id) or a hardcoded shortcut (special: ‘online’ | ‘offline’) to a user, switching their main availability and per-support-team…
PUT
/
availability-statuses
/
users
/
{user_id}
Apply user availability status
curl --request PUT \
--url http://localhost:8080/availability-statuses/users/{user_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "http://localhost:8080/availability-statuses/users/{user_id}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('http://localhost:8080/availability-statuses/users/{user_id}', 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 => "8080",
CURLOPT_URL => "http://localhost:8080/availability-statuses/users/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/availability-statuses/users/{user_id}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <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))
}HttpResponse<String> response = Unirest.put("http://localhost:8080/availability-statuses/users/{user_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/availability-statuses/users/{user_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"availability": {
"id": "<string>",
"user_id": 123,
"organization_id": "<string>",
"is_available": true,
"custom_status": "<string>",
"last_status_change": "2023-11-07T05:31:56Z",
"current_chat_count": 123,
"max_concurrent_chats": 123,
"notes": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"call_available": true,
"call_locked": true,
"call_wrap_up_until": "2023-11-07T05:31:56Z",
"call_wrap_up_phone_call_id": "<string>",
"availability_status_id": "<string>",
"call_wrap_up_started_at": "2023-11-07T05:31:56Z"
},
"resolved_status": {
"kind": "custom",
"status_id": "<string>",
"name": "<string>",
"availability_type": "offline",
"color": "blue"
},
"teams": [
{
"id": "<string>",
"name": "<string>",
"available": true
}
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Authorizations
Body
application/json
Was this page helpful?