curl --request POST \
--url https://api.absentify.com/api/v1/overtime-entries \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"allowance_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "<string>",
"amount": 123,
"member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"comment": "<string>",
"submission_id": "<string>"
}
'import requests
url = "https://api.absentify.com/api/v1/overtime-entries"
payload = {
"allowance_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "<string>",
"amount": 123,
"member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"comment": "<string>",
"submission_id": "<string>"
}
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',
date: '<string>',
amount: 123,
member_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
comment: '<string>',
submission_id: '<string>'
})
};
fetch('https://api.absentify.com/api/v1/overtime-entries', 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/overtime-entries",
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',
'date' => '<string>',
'amount' => 123,
'member_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'comment' => '<string>',
'submission_id' => '<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/overtime-entries"
payload := strings.NewReader("{\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"date\": \"<string>\",\n \"amount\": 123,\n \"member_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"comment\": \"<string>\",\n \"submission_id\": \"<string>\"\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/overtime-entries")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"date\": \"<string>\",\n \"amount\": 123,\n \"member_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"comment\": \"<string>\",\n \"submission_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/overtime-entries")
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 \"date\": \"<string>\",\n \"amount\": 123,\n \"member_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"comment\": \"<string>\",\n \"submission_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 0,
"member": {
"id": "<string>",
"custom_id": "<string>",
"name": "<string>",
"email": "<string>"
},
"allowance_type_id": "<string>",
"allowance_unit": "days",
"date": "<string>",
"amount": 123,
"recognized_amount": 123,
"day_kind": "WORKDAY",
"factor": 123,
"credit_expiry_date": "<string>",
"comment": "<string>",
"status": "PENDING",
"decided_by": {
"id": "<string>",
"custom_id": "<string>",
"name": "<string>",
"email": "<string>"
},
"decided_at": "<string>",
"created_by": {
"id": "<string>",
"custom_id": "<string>",
"name": "<string>",
"email": "<string>"
},
"created_at": "<string>",
"canceled_at": "<string>",
"canceled_by": {
"id": "<string>",
"custom_id": "<string>",
"name": "<string>",
"email": "<string>"
},
"decline_reason": "<string>",
"credited_amount": 123,
"credit_removed": 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": []
}Log overtime
Logs overtime on an allowance type that has overtime logging switched on. The entry follows the member’s normal approval chain and its approvers are notified; it is credited once approved. An admin can log for another active member of the workspace with member_id, otherwise it is logged for the API key’s member. Send the same submission_id again to get the existing entry back instead of a second one. Fails with 409 when that submission_id was already used for the same member with a different allowance type, date or amount.
curl --request POST \
--url https://api.absentify.com/api/v1/overtime-entries \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"allowance_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "<string>",
"amount": 123,
"member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"comment": "<string>",
"submission_id": "<string>"
}
'import requests
url = "https://api.absentify.com/api/v1/overtime-entries"
payload = {
"allowance_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "<string>",
"amount": 123,
"member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"comment": "<string>",
"submission_id": "<string>"
}
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',
date: '<string>',
amount: 123,
member_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
comment: '<string>',
submission_id: '<string>'
})
};
fetch('https://api.absentify.com/api/v1/overtime-entries', 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/overtime-entries",
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',
'date' => '<string>',
'amount' => 123,
'member_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'comment' => '<string>',
'submission_id' => '<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/overtime-entries"
payload := strings.NewReader("{\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"date\": \"<string>\",\n \"amount\": 123,\n \"member_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"comment\": \"<string>\",\n \"submission_id\": \"<string>\"\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/overtime-entries")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"allowance_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"date\": \"<string>\",\n \"amount\": 123,\n \"member_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"comment\": \"<string>\",\n \"submission_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/overtime-entries")
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 \"date\": \"<string>\",\n \"amount\": 123,\n \"member_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"comment\": \"<string>\",\n \"submission_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 0,
"member": {
"id": "<string>",
"custom_id": "<string>",
"name": "<string>",
"email": "<string>"
},
"allowance_type_id": "<string>",
"allowance_unit": "days",
"date": "<string>",
"amount": 123,
"recognized_amount": 123,
"day_kind": "WORKDAY",
"factor": 123,
"credit_expiry_date": "<string>",
"comment": "<string>",
"status": "PENDING",
"decided_by": {
"id": "<string>",
"custom_id": "<string>",
"name": "<string>",
"email": "<string>"
},
"decided_at": "<string>",
"created_by": {
"id": "<string>",
"custom_id": "<string>",
"name": "<string>",
"email": "<string>"
},
"created_at": "<string>",
"canceled_at": "<string>",
"canceled_by": {
"id": "<string>",
"custom_id": "<string>",
"name": "<string>",
"email": "<string>"
},
"decline_reason": "<string>",
"credited_amount": 123,
"credit_removed": 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": []
}Body
Makes a retry safe: the same value for the same member with the same allowance type, date and amount returns the existing entry. With a different allowance type, date or amount it fails with 409. Generated when omitted, in which case a retry logs a second entry.
8 - 64Response
Successful response
Was this page helpful?