Get a time-off policy
curl --request GET \
--url https://a-char.com/api/v1/policies/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://a-char.com/api/v1/policies/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://a-char.com/api/v1/policies/{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_URL => "https://a-char.com/api/v1/policies/{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 := "https://a-char.com/api/v1/policies/{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("https://a-char.com/api/v1/policies/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://a-char.com/api/v1/policies/{id}")
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{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "<string>",
"accrual_cycle_id": "<string>",
"activity_type": "not_working_paid",
"allowance_entitlement": "base_annual_allowance",
"annual_allowance": 123,
"balance_rounding": "nearest",
"color": "cyan",
"country_code": "AD",
"deductible_days": "any_day",
"description": "<string>",
"effective_date": "<string>",
"is_active": true,
"is_approval_required": true,
"is_request_note_mandatory": true,
"max_carryover_days": 123,
"name": "<string>",
"notice_period": "days",
"notice_period_count": 123,
"precision": "one_decimal_place",
"request_attachment_requirement": "none",
"shortest_request_amount": "half_day",
"document_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approval_document_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"decline_document_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"employee_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Policies
Get a time-off policy
A single time-off policy with the ids of the employees currently assigned to it, or null when no such policy exists. Requires the policies:config:read scope.
GET
/
policies
/
{id}
Get a time-off policy
curl --request GET \
--url https://a-char.com/api/v1/policies/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://a-char.com/api/v1/policies/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://a-char.com/api/v1/policies/{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_URL => "https://a-char.com/api/v1/policies/{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 := "https://a-char.com/api/v1/policies/{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("https://a-char.com/api/v1/policies/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://a-char.com/api/v1/policies/{id}")
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{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "<string>",
"accrual_cycle_id": "<string>",
"activity_type": "not_working_paid",
"allowance_entitlement": "base_annual_allowance",
"annual_allowance": 123,
"balance_rounding": "nearest",
"color": "cyan",
"country_code": "AD",
"deductible_days": "any_day",
"description": "<string>",
"effective_date": "<string>",
"is_active": true,
"is_approval_required": true,
"is_request_note_mandatory": true,
"max_carryover_days": 123,
"name": "<string>",
"notice_period": "days",
"notice_period_count": 123,
"precision": "one_decimal_place",
"request_attachment_requirement": "none",
"shortest_request_amount": "half_day",
"document_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approval_document_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"decline_document_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"employee_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
200 - application/json
object | null
OK
Available options:
not_working_paid, not_working_unpaid, working Available options:
base_annual_allowance, unlimited Available options:
nearest, round_up Available options:
cyan, sky, blue, indigo, pink, rose, red, lime, green, emerald, teal, purple, violet, yellow, orange, amber, gray, zinc Available options:
AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, YE, YT, ZA, ZM, ZW Available options:
any_day, any_day_excluding_holidays, workdays_only Available options:
days, weeks, months Available options:
one_decimal_place, two_decimal_places, half, whole_number Available options:
none, optional, mandatory Available options:
half_day, day