POST /rest/absence_types — Create a custom absence type
curl --request POST \
--url https://{tenant}.stamp.eu/rest/absence_types \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"name": "<string>",
"color": "<string>",
"icon": "<string>",
"half_day_allowed": true,
"affects_vacation": true,
"target_work_factor": 0.5,
"working_time_flag": 123,
"requires_approval": true,
"is_paid": true,
"certificate_required": true,
"certificate_deadline_days": 2,
"count_weekdays_only": true,
"sort_order": 1
}
'import requests
url = "https://{tenant}.stamp.eu/rest/absence_types"
payload = {
"slug": "<string>",
"name": "<string>",
"color": "<string>",
"icon": "<string>",
"half_day_allowed": True,
"affects_vacation": True,
"target_work_factor": 0.5,
"working_time_flag": 123,
"requires_approval": True,
"is_paid": True,
"certificate_required": True,
"certificate_deadline_days": 2,
"count_weekdays_only": True,
"sort_order": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
slug: '<string>',
name: '<string>',
color: '<string>',
icon: '<string>',
half_day_allowed: true,
affects_vacation: true,
target_work_factor: 0.5,
working_time_flag: 123,
requires_approval: true,
is_paid: true,
certificate_required: true,
certificate_deadline_days: 2,
count_weekdays_only: true,
sort_order: 1
})
};
fetch('https://{tenant}.stamp.eu/rest/absence_types', 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://{tenant}.stamp.eu/rest/absence_types",
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([
'slug' => '<string>',
'name' => '<string>',
'color' => '<string>',
'icon' => '<string>',
'half_day_allowed' => true,
'affects_vacation' => true,
'target_work_factor' => 0.5,
'working_time_flag' => 123,
'requires_approval' => true,
'is_paid' => true,
'certificate_required' => true,
'certificate_deadline_days' => 2,
'count_weekdays_only' => true,
'sort_order' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{tenant}.stamp.eu/rest/absence_types"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"color\": \"<string>\",\n \"icon\": \"<string>\",\n \"half_day_allowed\": true,\n \"affects_vacation\": true,\n \"target_work_factor\": 0.5,\n \"working_time_flag\": 123,\n \"requires_approval\": true,\n \"is_paid\": true,\n \"certificate_required\": true,\n \"certificate_deadline_days\": 2,\n \"count_weekdays_only\": true,\n \"sort_order\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{tenant}.stamp.eu/rest/absence_types")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"color\": \"<string>\",\n \"icon\": \"<string>\",\n \"half_day_allowed\": true,\n \"affects_vacation\": true,\n \"target_work_factor\": 0.5,\n \"working_time_flag\": 123,\n \"requires_approval\": true,\n \"is_paid\": true,\n \"certificate_required\": true,\n \"certificate_deadline_days\": 2,\n \"count_weekdays_only\": true,\n \"sort_order\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.stamp.eu/rest/absence_types")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"color\": \"<string>\",\n \"icon\": \"<string>\",\n \"half_day_allowed\": true,\n \"affects_vacation\": true,\n \"target_work_factor\": 0.5,\n \"working_time_flag\": 123,\n \"requires_approval\": true,\n \"is_paid\": true,\n \"certificate_required\": true,\n \"certificate_deadline_days\": 2,\n \"count_weekdays_only\": true,\n \"sort_order\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"color": "<string>",
"icon": "<string>",
"is_system": "<string>",
"category": "<string>",
"unit": "<string>",
"half_day_allowed": "<string>",
"affects_vacation": "<string>",
"target_work_factor": 123,
"working_time_flag": "<string>",
"requires_approval": "<string>",
"is_paid": "<string>",
"certificate_required": "<string>",
"certificate_deadline_days": "<string>",
"substitute_option": "<string>",
"count_weekdays_only": "<string>",
"is_active": "<string>",
"sort_order": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Abwesenheitsarten
Abwesenheitsart erstellen
POST
/
absence_types
POST /rest/absence_types — Create a custom absence type
curl --request POST \
--url https://{tenant}.stamp.eu/rest/absence_types \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"name": "<string>",
"color": "<string>",
"icon": "<string>",
"half_day_allowed": true,
"affects_vacation": true,
"target_work_factor": 0.5,
"working_time_flag": 123,
"requires_approval": true,
"is_paid": true,
"certificate_required": true,
"certificate_deadline_days": 2,
"count_weekdays_only": true,
"sort_order": 1
}
'import requests
url = "https://{tenant}.stamp.eu/rest/absence_types"
payload = {
"slug": "<string>",
"name": "<string>",
"color": "<string>",
"icon": "<string>",
"half_day_allowed": True,
"affects_vacation": True,
"target_work_factor": 0.5,
"working_time_flag": 123,
"requires_approval": True,
"is_paid": True,
"certificate_required": True,
"certificate_deadline_days": 2,
"count_weekdays_only": True,
"sort_order": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
slug: '<string>',
name: '<string>',
color: '<string>',
icon: '<string>',
half_day_allowed: true,
affects_vacation: true,
target_work_factor: 0.5,
working_time_flag: 123,
requires_approval: true,
is_paid: true,
certificate_required: true,
certificate_deadline_days: 2,
count_weekdays_only: true,
sort_order: 1
})
};
fetch('https://{tenant}.stamp.eu/rest/absence_types', 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://{tenant}.stamp.eu/rest/absence_types",
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([
'slug' => '<string>',
'name' => '<string>',
'color' => '<string>',
'icon' => '<string>',
'half_day_allowed' => true,
'affects_vacation' => true,
'target_work_factor' => 0.5,
'working_time_flag' => 123,
'requires_approval' => true,
'is_paid' => true,
'certificate_required' => true,
'certificate_deadline_days' => 2,
'count_weekdays_only' => true,
'sort_order' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{tenant}.stamp.eu/rest/absence_types"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"color\": \"<string>\",\n \"icon\": \"<string>\",\n \"half_day_allowed\": true,\n \"affects_vacation\": true,\n \"target_work_factor\": 0.5,\n \"working_time_flag\": 123,\n \"requires_approval\": true,\n \"is_paid\": true,\n \"certificate_required\": true,\n \"certificate_deadline_days\": 2,\n \"count_weekdays_only\": true,\n \"sort_order\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{tenant}.stamp.eu/rest/absence_types")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"color\": \"<string>\",\n \"icon\": \"<string>\",\n \"half_day_allowed\": true,\n \"affects_vacation\": true,\n \"target_work_factor\": 0.5,\n \"working_time_flag\": 123,\n \"requires_approval\": true,\n \"is_paid\": true,\n \"certificate_required\": true,\n \"certificate_deadline_days\": 2,\n \"count_weekdays_only\": true,\n \"sort_order\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.stamp.eu/rest/absence_types")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"color\": \"<string>\",\n \"icon\": \"<string>\",\n \"half_day_allowed\": true,\n \"affects_vacation\": true,\n \"target_work_factor\": 0.5,\n \"working_time_flag\": 123,\n \"requires_approval\": true,\n \"is_paid\": true,\n \"certificate_required\": true,\n \"certificate_deadline_days\": 2,\n \"count_weekdays_only\": true,\n \"sort_order\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"color": "<string>",
"icon": "<string>",
"is_system": "<string>",
"category": "<string>",
"unit": "<string>",
"half_day_allowed": "<string>",
"affects_vacation": "<string>",
"target_work_factor": 123,
"working_time_flag": "<string>",
"requires_approval": "<string>",
"is_paid": "<string>",
"certificate_required": "<string>",
"certificate_deadline_days": "<string>",
"substitute_option": "<string>",
"count_weekdays_only": "<string>",
"is_active": "<string>",
"sort_order": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
Bearer-Token, erhalten über den Login-Endpunkt (POST /rest/login).
Body
application/json
Maximum string length:
100Pattern:
^[a-z0-9_]+$Maximum string length:
255Available options:
standard, productive Available options:
day, hour Available options:
disabled, optional, required Maximum string length:
7Pattern:
^#[0-9A-Fa-f]{6}$Maximum string length:
100Required range:
0 <= x <= 1Required range:
x >= 1Required range:
x >= 0Response
AbsenceTypeResource
Show child attributes
Show child attributes
⌘I