Update absence
curl --request PATCH \
--url http://localhost:3000/v2/absences/{id} \
--header 'Content-Type: application/json' \
--header 'x-API-Key: <api-key>' \
--data '
{
"dtStart": "2023-11-07T05:31:56Z",
"dtEnd": "2023-11-07T05:31:56Z",
"daysAbsent": 123,
"type": 123,
"desc": "<string>",
"payTypeAbsenceId": "<string>",
"calculationType": "<string>",
"imageIds": [
"<string>"
]
}
'import requests
url = "http://localhost:3000/v2/absences/{id}"
payload = {
"dtStart": "2023-11-07T05:31:56Z",
"dtEnd": "2023-11-07T05:31:56Z",
"daysAbsent": 123,
"type": 123,
"desc": "<string>",
"payTypeAbsenceId": "<string>",
"calculationType": "<string>",
"imageIds": ["<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({
dtStart: '2023-11-07T05:31:56Z',
dtEnd: '2023-11-07T05:31:56Z',
daysAbsent: 123,
type: 123,
desc: '<string>',
payTypeAbsenceId: '<string>',
calculationType: '<string>',
imageIds: ['<string>']
})
};
fetch('http://localhost:3000/v2/absences/{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_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v2/absences/{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([
'dtStart' => '2023-11-07T05:31:56Z',
'dtEnd' => '2023-11-07T05:31:56Z',
'daysAbsent' => 123,
'type' => 123,
'desc' => '<string>',
'payTypeAbsenceId' => '<string>',
'calculationType' => '<string>',
'imageIds' => [
'<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 := "http://localhost:3000/v2/absences/{id}"
payload := strings.NewReader("{\n \"dtStart\": \"2023-11-07T05:31:56Z\",\n \"dtEnd\": \"2023-11-07T05:31:56Z\",\n \"daysAbsent\": 123,\n \"type\": 123,\n \"desc\": \"<string>\",\n \"payTypeAbsenceId\": \"<string>\",\n \"calculationType\": \"<string>\",\n \"imageIds\": [\n \"<string>\"\n ]\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("http://localhost:3000/v2/absences/{id}")
.header("x-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dtStart\": \"2023-11-07T05:31:56Z\",\n \"dtEnd\": \"2023-11-07T05:31:56Z\",\n \"daysAbsent\": 123,\n \"type\": 123,\n \"desc\": \"<string>\",\n \"payTypeAbsenceId\": \"<string>\",\n \"calculationType\": \"<string>\",\n \"imageIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v2/absences/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["x-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dtStart\": \"2023-11-07T05:31:56Z\",\n \"dtEnd\": \"2023-11-07T05:31:56Z\",\n \"daysAbsent\": 123,\n \"type\": 123,\n \"desc\": \"<string>\",\n \"payTypeAbsenceId\": \"<string>\",\n \"calculationType\": \"<string>\",\n \"imageIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"updated": true
}Absences
Update Absence
Update an existing absence record with new data. Only provided fields will be updated.
PATCH
/
absences
/
{id}
Update absence
curl --request PATCH \
--url http://localhost:3000/v2/absences/{id} \
--header 'Content-Type: application/json' \
--header 'x-API-Key: <api-key>' \
--data '
{
"dtStart": "2023-11-07T05:31:56Z",
"dtEnd": "2023-11-07T05:31:56Z",
"daysAbsent": 123,
"type": 123,
"desc": "<string>",
"payTypeAbsenceId": "<string>",
"calculationType": "<string>",
"imageIds": [
"<string>"
]
}
'import requests
url = "http://localhost:3000/v2/absences/{id}"
payload = {
"dtStart": "2023-11-07T05:31:56Z",
"dtEnd": "2023-11-07T05:31:56Z",
"daysAbsent": 123,
"type": 123,
"desc": "<string>",
"payTypeAbsenceId": "<string>",
"calculationType": "<string>",
"imageIds": ["<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({
dtStart: '2023-11-07T05:31:56Z',
dtEnd: '2023-11-07T05:31:56Z',
daysAbsent: 123,
type: 123,
desc: '<string>',
payTypeAbsenceId: '<string>',
calculationType: '<string>',
imageIds: ['<string>']
})
};
fetch('http://localhost:3000/v2/absences/{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_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v2/absences/{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([
'dtStart' => '2023-11-07T05:31:56Z',
'dtEnd' => '2023-11-07T05:31:56Z',
'daysAbsent' => 123,
'type' => 123,
'desc' => '<string>',
'payTypeAbsenceId' => '<string>',
'calculationType' => '<string>',
'imageIds' => [
'<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 := "http://localhost:3000/v2/absences/{id}"
payload := strings.NewReader("{\n \"dtStart\": \"2023-11-07T05:31:56Z\",\n \"dtEnd\": \"2023-11-07T05:31:56Z\",\n \"daysAbsent\": 123,\n \"type\": 123,\n \"desc\": \"<string>\",\n \"payTypeAbsenceId\": \"<string>\",\n \"calculationType\": \"<string>\",\n \"imageIds\": [\n \"<string>\"\n ]\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("http://localhost:3000/v2/absences/{id}")
.header("x-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dtStart\": \"2023-11-07T05:31:56Z\",\n \"dtEnd\": \"2023-11-07T05:31:56Z\",\n \"daysAbsent\": 123,\n \"type\": 123,\n \"desc\": \"<string>\",\n \"payTypeAbsenceId\": \"<string>\",\n \"calculationType\": \"<string>\",\n \"imageIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v2/absences/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["x-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dtStart\": \"2023-11-07T05:31:56Z\",\n \"dtEnd\": \"2023-11-07T05:31:56Z\",\n \"daysAbsent\": 123,\n \"type\": 123,\n \"desc\": \"<string>\",\n \"payTypeAbsenceId\": \"<string>\",\n \"calculationType\": \"<string>\",\n \"imageIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"updated": true
}Authorizations
API-KeyBearer-Auth
Path Parameters
Absence ID to update
Body
application/json
Absence update data
Start date/time of the absence (UTC timestamp)
End date/time of the absence (UTC timestamp)
Number of days absent
Absence type
Description or comment for the absence
Pay type absence ID
Calculation type
Image IDs associated with the absence
Response
Absence updated successfully
Example:
true
Was this page helpful?
⌘I

