curl --request GET \
--url https://api-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances', 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-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances",
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 := "https://api-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances"
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("https://api-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"ruleId": "55555555-5555-4555-8555-555555555555",
"name": "Viernes tarde",
"source": "multiplier_rule",
"balanceSeconds": 8100,
"hoursCompensationAbsenceTypeId": null
},
{
"ruleId": "66666666-6666-4666-8666-666666666666",
"name": "Nocturnidad",
"source": "typifying_rule",
"balanceSeconds": 3600,
"hoursCompensationAbsenceTypeId": "199932f8-c295-42b9-8588-b5ec181a3767"
}
],
"meta": {
"currentPage": 1,
"lastPage": 1,
"total": 2,
"perPage": 2
}
}Get the balance of every overtime rule of an employee
Returns, for the employee employeeId and the from-to period (closed days only: up to yesterday), the balance of every multiplier and typifying rule assigned to the employee or with generated time or movements in the period. The balance is the generated time plus the rule adjustments, minus the rule compensations, and can be negative. Read it right before POST /overtime-policies/v1/adjustments with a rule source and copy from the item of the rule ruleId and source as they are, and balanceSeconds as balanceBeforeSeconds. The read permission is checked over the employee: an employee the API consumer has no role over answers 403. When the permission passes, as it does for a company-wide API consumer, an id that is not an employee of the company of the token (including an unknown id) answers 200 with an empty list.
curl --request GET \
--url https://api-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances', 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-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances",
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 := "https://api-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances"
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("https://api-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-{region}.sesametime.com/overtime-policies/v1/employees/{employeeId}/rule-balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"ruleId": "55555555-5555-4555-8555-555555555555",
"name": "Viernes tarde",
"source": "multiplier_rule",
"balanceSeconds": 8100,
"hoursCompensationAbsenceTypeId": null
},
{
"ruleId": "66666666-6666-4666-8666-666666666666",
"name": "Nocturnidad",
"source": "typifying_rule",
"balanceSeconds": 3600,
"hoursCompensationAbsenceTypeId": "199932f8-c295-42b9-8588-b5ec181a3767"
}
],
"meta": {
"currentPage": 1,
"lastPage": 1,
"total": 2,
"perPage": 2
}
}Authorizations
Path Parameters
Query Parameters
Response
Balance of every rule of the employee for the period, multiplier rules first, then typifying rules. When the period has no closed day (it starts today or later) the assigned rules are listed with balanceSeconds 0. meta counts the items (total = perPage = number of rules).
Was this page helpful?