curl --request POST \
--url https://api.example.com/api/balances/resources.show-effective \
--header 'Content-Type: application/json' \
--data '
{
"resource_ids": [
"872815618512410358"
],
"time_range": "2019-11-11T12:34:56/2019-12-12T23:59:59"
}
'import requests
url = "https://api.example.com/api/balances/resources.show-effective"
payload = {
"resource_ids": ["872815618512410358"],
"time_range": "2019-11-11T12:34:56/2019-12-12T23:59:59"
}
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({
resource_ids: ['872815618512410358'],
time_range: '2019-11-11T12:34:56/2019-12-12T23:59:59'
})
};
fetch('https://api.example.com/api/balances/resources.show-effective', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/balances/resources.show-effective",
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([
'resource_ids' => [
'872815618512410358'
],
'time_range' => '2019-11-11T12:34:56/2019-12-12T23:59:59'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/balances/resources.show-effective"
payload := strings.NewReader("{\n \"resource_ids\": [\n \"872815618512410358\"\n ],\n \"time_range\": \"2019-11-11T12:34:56/2019-12-12T23:59:59\"\n}")
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))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/balances/resources.show-effective")
.header("Content-Type", "application/json")
.body("{\n \"resource_ids\": [\n \"872815618512410358\"\n ],\n \"time_range\": \"2019-11-11T12:34:56/2019-12-12T23:59:59\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/balances/resources.show-effective")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource_ids\": [\n \"872815618512410358\"\n ],\n \"time_range\": \"2019-11-11T12:34:56/2019-12-12T23:59:59\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": "872815618512410358",
"resource_id": "872815618512410358",
"team_id": "872815618512410358",
"kind": "compensation",
"is_presence": true,
"time_range": "2019-11-11T12:34:56/2019-12-12T23:59:59",
"duration": "PT1H30M20S",
"tag_ids": [
"872815618512410358"
],
"absence_type_id": "872815618512410358",
"absence_id": "872815618512410358",
"schedule_id": "872815618512410358",
"schedule_template_id": "872815618512410358",
"schedule_template_type_id": "872815618512410358",
"timecheck_id": "872815618512410358",
"on_call_id": "872815618512410358",
"compensation_id": "872815618512410358"
}
]Show effective
Retrieves the effective time blocks (worked, absence, on-call, etc.) of the given resources over a time range, returned as-is (not aggregated by day) and sorted by time range. Resources the caller is not allowed to see are silently omitted from the response, and each block only carries the relation ids relevant to its kind. The requested volume is capped: the number of distinct resources multiplied by the number of days covered by the time range must not exceed 366.
curl --request POST \
--url https://api.example.com/api/balances/resources.show-effective \
--header 'Content-Type: application/json' \
--data '
{
"resource_ids": [
"872815618512410358"
],
"time_range": "2019-11-11T12:34:56/2019-12-12T23:59:59"
}
'import requests
url = "https://api.example.com/api/balances/resources.show-effective"
payload = {
"resource_ids": ["872815618512410358"],
"time_range": "2019-11-11T12:34:56/2019-12-12T23:59:59"
}
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({
resource_ids: ['872815618512410358'],
time_range: '2019-11-11T12:34:56/2019-12-12T23:59:59'
})
};
fetch('https://api.example.com/api/balances/resources.show-effective', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/balances/resources.show-effective",
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([
'resource_ids' => [
'872815618512410358'
],
'time_range' => '2019-11-11T12:34:56/2019-12-12T23:59:59'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/balances/resources.show-effective"
payload := strings.NewReader("{\n \"resource_ids\": [\n \"872815618512410358\"\n ],\n \"time_range\": \"2019-11-11T12:34:56/2019-12-12T23:59:59\"\n}")
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))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/balances/resources.show-effective")
.header("Content-Type", "application/json")
.body("{\n \"resource_ids\": [\n \"872815618512410358\"\n ],\n \"time_range\": \"2019-11-11T12:34:56/2019-12-12T23:59:59\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/balances/resources.show-effective")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource_ids\": [\n \"872815618512410358\"\n ],\n \"time_range\": \"2019-11-11T12:34:56/2019-12-12T23:59:59\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": "872815618512410358",
"resource_id": "872815618512410358",
"team_id": "872815618512410358",
"kind": "compensation",
"is_presence": true,
"time_range": "2019-11-11T12:34:56/2019-12-12T23:59:59",
"duration": "PT1H30M20S",
"tag_ids": [
"872815618512410358"
],
"absence_type_id": "872815618512410358",
"absence_id": "872815618512410358",
"schedule_id": "872815618512410358",
"schedule_template_id": "872815618512410358",
"schedule_template_type_id": "872815618512410358",
"timecheck_id": "872815618512410358",
"on_call_id": "872815618512410358",
"compensation_id": "872815618512410358"
}
]Body
Response
"872815618512410358"
"872815618512410358"
"872815618512410358"
compensation, adjustment, absence, schedule, timecheck, on-call, paid-break "compensation"
"2019-11-11T12:34:56/2019-12-12T23:59:59"
"PT1H30M20S"
"872815618512410358"
"872815618512410358"
"872815618512410358"
"872815618512410358"
"872815618512410358"
"872815618512410358"
"872815618512410358"
"872815618512410358"