curl --request POST \
--url https://api.absentify.com/api/v1/members/{member_id}/manual-rule \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"allowance_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valid_from": "<string>",
"reason": "<string>",
"valid_until": "<string>",
"current_assignment_id": 0
}
'import requests
url = "https://api.absentify.com/api/v1/members/{member_id}/manual-rule"
payload = {
"allowance_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valid_from": "<string>",
"reason": "<string>",
"valid_until": "<string>",
"current_assignment_id": 0
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
allowance_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valid_from: '<string>',
reason: '<string>',
valid_until: '<string>',
current_assignment_id: 0
})
};
fetch('https://api.absentify.com/api/v1/members/{member_id}/manual-rule', 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/members/{member_id}/manual-rule",
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([
'allowance_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valid_from' => '<string>',
'reason' => '<string>',
'valid_until' => '<string>',
'current_assignment_id' => 0
]),
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/members/{member_id}/manual-rule"
payload := strings.NewReader("{\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valid_from\": \"<string>\",\n \"reason\": \"<string>\",\n \"valid_until\": \"<string>\",\n \"current_assignment_id\": 0\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.absentify.com/api/v1/members/{member_id}/manual-rule")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valid_from\": \"<string>\",\n \"reason\": \"<string>\",\n \"valid_until\": \"<string>\",\n \"current_assignment_id\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/members/{member_id}/manual-rule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valid_from\": \"<string>\",\n \"reason\": \"<string>\",\n \"valid_until\": \"<string>\",\n \"current_assignment_id\": 0\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Switch a member to manual allowance management
Takes the member off automatic accrual for this allowance type from valid_from on. Nothing accrues afterwards, and the balance is whatever you set through adjustments. Pass the member’s active assignment as current_assignment_id and it is ended on valid_from in the same transaction; without it, an assignment overlapping valid_from makes the call fail. A valid_until is only accepted on the day before the next assignment starts or on the member’s last employment day, so leave it null to stay open ended. Gaps or overlaps that predate this rule are tolerated, but the switch may not widen them.
curl --request POST \
--url https://api.absentify.com/api/v1/members/{member_id}/manual-rule \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"allowance_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valid_from": "<string>",
"reason": "<string>",
"valid_until": "<string>",
"current_assignment_id": 0
}
'import requests
url = "https://api.absentify.com/api/v1/members/{member_id}/manual-rule"
payload = {
"allowance_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"valid_from": "<string>",
"reason": "<string>",
"valid_until": "<string>",
"current_assignment_id": 0
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
allowance_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
valid_from: '<string>',
reason: '<string>',
valid_until: '<string>',
current_assignment_id: 0
})
};
fetch('https://api.absentify.com/api/v1/members/{member_id}/manual-rule', 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/members/{member_id}/manual-rule",
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([
'allowance_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'valid_from' => '<string>',
'reason' => '<string>',
'valid_until' => '<string>',
'current_assignment_id' => 0
]),
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/members/{member_id}/manual-rule"
payload := strings.NewReader("{\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valid_from\": \"<string>\",\n \"reason\": \"<string>\",\n \"valid_until\": \"<string>\",\n \"current_assignment_id\": 0\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.absentify.com/api/v1/members/{member_id}/manual-rule")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valid_from\": \"<string>\",\n \"reason\": \"<string>\",\n \"valid_until\": \"<string>\",\n \"current_assignment_id\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/members/{member_id}/manual-rule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"valid_from\": \"<string>\",\n \"reason\": \"<string>\",\n \"valid_until\": \"<string>\",\n \"current_assignment_id\": 0\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"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
^([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})$First day the member is managed manually (inclusive), in YYYY-MM-DD format.
^\d{4}-\d{2}-\d{2}$Why the member is managed manually — stored in the rule audit log.
3 - 500Last day of manual management (inclusive), in YYYY-MM-DD format, or null for open-ended.
^\d{4}-\d{2}-\d{2}$The assignment that is active today, from GET /members/{member_id}/rule-assignments. Send null when the member has none.
-9007199254740991 <= x <= 9007199254740991Antwort
Successful response
War diese Seite hilfreich?