Get user availability status
curl --request GET \
--url http://localhost:8080/availability-statuses/users/{user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/availability-statuses/users/{user_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/availability-statuses/users/{user_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/availability-statuses/users/{user_id}")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
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
Get user availability status
Get a user’s current availability: the raw availability record, the resolved status (an applied defined status, or the derived online / offline / mixed state), and the full…
GET
/
availability-statuses
/
users
/
{user_id}
Get user availability status
curl --request GET \
--url http://localhost:8080/availability-statuses/users/{user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/availability-statuses/users/{user_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/availability-statuses/users/{user_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/availability-statuses/users/{user_id}")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
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
Was this page helpful?