curl --request PATCH \
--url https://api.absentify.com/api/v1/rules/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"accrual_month": 5,
"rule_amount": 123,
"accrual_anchor_date": "<string>",
"cycle_on_employment_start": true,
"rule_duration": 600,
"upfront_allocation": true,
"max_carry_forward": 50000,
"carry_forward_expiry_months": 600,
"carry_forward_kept_after_expiry": 50000,
"reason": "<string>"
}
'import requests
url = "https://api.absentify.com/api/v1/rules/{id}"
payload = {
"name": "<string>",
"accrual_month": 5,
"rule_amount": 123,
"accrual_anchor_date": "<string>",
"cycle_on_employment_start": True,
"rule_duration": 600,
"upfront_allocation": True,
"max_carry_forward": 50000,
"carry_forward_expiry_months": 600,
"carry_forward_kept_after_expiry": 50000,
"reason": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
accrual_month: 5,
rule_amount: 123,
accrual_anchor_date: '<string>',
cycle_on_employment_start: true,
rule_duration: 600,
upfront_allocation: true,
max_carry_forward: 50000,
carry_forward_expiry_months: 600,
carry_forward_kept_after_expiry: 50000,
reason: '<string>'
})
};
fetch('https://api.absentify.com/api/v1/rules/{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://api.absentify.com/api/v1/rules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'accrual_month' => 5,
'rule_amount' => 123,
'accrual_anchor_date' => '<string>',
'cycle_on_employment_start' => true,
'rule_duration' => 600,
'upfront_allocation' => true,
'max_carry_forward' => 50000,
'carry_forward_expiry_months' => 600,
'carry_forward_kept_after_expiry' => 50000,
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.absentify.com/api/v1/rules/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"accrual_month\": 5,\n \"rule_amount\": 123,\n \"accrual_anchor_date\": \"<string>\",\n \"cycle_on_employment_start\": true,\n \"rule_duration\": 600,\n \"upfront_allocation\": true,\n \"max_carry_forward\": 50000,\n \"carry_forward_expiry_months\": 600,\n \"carry_forward_kept_after_expiry\": 50000,\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.patch("https://api.absentify.com/api/v1/rules/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"accrual_month\": 5,\n \"rule_amount\": 123,\n \"accrual_anchor_date\": \"<string>\",\n \"cycle_on_employment_start\": true,\n \"rule_duration\": 600,\n \"upfront_allocation\": true,\n \"max_carry_forward\": 50000,\n \"carry_forward_expiry_months\": 600,\n \"carry_forward_kept_after_expiry\": 50000,\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"accrual_month\": 5,\n \"rule_amount\": 123,\n \"accrual_anchor_date\": \"<string>\",\n \"cycle_on_employment_start\": true,\n \"rule_duration\": 600,\n \"upfront_allocation\": true,\n \"max_carry_forward\": 50000,\n \"carry_forward_expiry_months\": 600,\n \"carry_forward_kept_after_expiry\": 50000,\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"count": 123
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Update an allowance rule
Updates an existing allowance rule. Only provide the fields you want to change. Changes are applied to all members subscribed to this rule.
curl --request PATCH \
--url https://api.absentify.com/api/v1/rules/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"accrual_month": 5,
"rule_amount": 123,
"accrual_anchor_date": "<string>",
"cycle_on_employment_start": true,
"rule_duration": 600,
"upfront_allocation": true,
"max_carry_forward": 50000,
"carry_forward_expiry_months": 600,
"carry_forward_kept_after_expiry": 50000,
"reason": "<string>"
}
'import requests
url = "https://api.absentify.com/api/v1/rules/{id}"
payload = {
"name": "<string>",
"accrual_month": 5,
"rule_amount": 123,
"accrual_anchor_date": "<string>",
"cycle_on_employment_start": True,
"rule_duration": 600,
"upfront_allocation": True,
"max_carry_forward": 50000,
"carry_forward_expiry_months": 600,
"carry_forward_kept_after_expiry": 50000,
"reason": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
accrual_month: 5,
rule_amount: 123,
accrual_anchor_date: '<string>',
cycle_on_employment_start: true,
rule_duration: 600,
upfront_allocation: true,
max_carry_forward: 50000,
carry_forward_expiry_months: 600,
carry_forward_kept_after_expiry: 50000,
reason: '<string>'
})
};
fetch('https://api.absentify.com/api/v1/rules/{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://api.absentify.com/api/v1/rules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'accrual_month' => 5,
'rule_amount' => 123,
'accrual_anchor_date' => '<string>',
'cycle_on_employment_start' => true,
'rule_duration' => 600,
'upfront_allocation' => true,
'max_carry_forward' => 50000,
'carry_forward_expiry_months' => 600,
'carry_forward_kept_after_expiry' => 50000,
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.absentify.com/api/v1/rules/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"accrual_month\": 5,\n \"rule_amount\": 123,\n \"accrual_anchor_date\": \"<string>\",\n \"cycle_on_employment_start\": true,\n \"rule_duration\": 600,\n \"upfront_allocation\": true,\n \"max_carry_forward\": 50000,\n \"carry_forward_expiry_months\": 600,\n \"carry_forward_kept_after_expiry\": 50000,\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.patch("https://api.absentify.com/api/v1/rules/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"accrual_month\": 5,\n \"rule_amount\": 123,\n \"accrual_anchor_date\": \"<string>\",\n \"cycle_on_employment_start\": true,\n \"rule_duration\": 600,\n \"upfront_allocation\": true,\n \"max_carry_forward\": 50000,\n \"carry_forward_expiry_months\": 600,\n \"carry_forward_kept_after_expiry\": 50000,\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"accrual_month\": 5,\n \"rule_amount\": 123,\n \"accrual_anchor_date\": \"<string>\",\n \"cycle_on_employment_start\": true,\n \"rule_duration\": 600,\n \"upfront_allocation\": true,\n \"max_carry_forward\": 50000,\n \"carry_forward_expiry_months\": 600,\n \"carry_forward_kept_after_expiry\": 50000,\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"count": 123
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Autorisierungen
Pfadparameter
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Body
10 <= x <= 11Allowance amount per accrual cycle, must be greater than 0. For hour-based allowance types the value is in MINUTES (e.g. 480 = 8 hours). Omit to leave a stored 0-amount (manual) rule unchanged.
x <= 100000month, year, biweek ^\d{4}-\d{2}-\d{2}$Per-accrual rolling expiry in months (each accrual valid this many months from its accrual date). Min 1; null = off. Cannot be combined with any carry-forward setting, and is not allowed on a 0-amount (manual) rule.
1 <= x <= 1200How partial yearly rules are prorated. month = whole months count fully, the partial start or end month is prorated by day; day = calendar-day exact; full_month = only whole months count 1/12 each, a started month counts nothing. Ignored for monthly and biweekly cycles. Defaults to month.
month, day, full_month Hard cap on the amount carried into the next fiscal year, applied at the year boundary. null = unlimited (everything carries), 0 = nothing carries. For hour-based allowance types the value is in MINUTES.
0 <= x <= 100000How long carried-forward allowance stays usable in the new fiscal year. null = it never expires; N (>= 1) = months after fiscal year end.
1 <= x <= 1200Amount surviving permanently after the expiry deadline. Requires carry_forward_expiry_months; must be lower than max_carry_forward when both are set.
0 <= x <= 100000Why this rule is being changed — stored in the rule audit log.
3 - 500Antwort
Successful response
War diese Seite hilfreich?