Update your time off!
curl --request PATCH \
--url https://platform.thena.ai/v1/users/time-off/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"startDate": "2024-01-01T00:00:00.000Z",
"endDate": "2024-01-02T23:59:59.999Z",
"type": "VACATION",
"description": "I'm going to be on vacation"
}
EOFimport requests
url = "https://platform.thena.ai/v1/users/time-off/{id}"
payload = {
"startDate": "2024-01-01T00:00:00.000Z",
"endDate": "2024-01-02T23:59:59.999Z",
"type": "VACATION",
"description": "I'm going to be on vacation"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2024-01-01T00:00:00.000Z',
endDate: '2024-01-02T23:59:59.999Z',
type: 'VACATION',
description: 'I\'m going to be on vacation'
})
};
fetch('https://platform.thena.ai/v1/users/time-off/{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://platform.thena.ai/v1/users/time-off/{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([
'startDate' => '2024-01-01T00:00:00.000Z',
'endDate' => '2024-01-02T23:59:59.999Z',
'type' => 'VACATION',
'description' => 'I\'m going to be on vacation'
]),
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://platform.thena.ai/v1/users/time-off/{id}"
payload := strings.NewReader("{\n \"startDate\": \"2024-01-01T00:00:00.000Z\",\n \"endDate\": \"2024-01-02T23:59:59.999Z\",\n \"type\": \"VACATION\",\n \"description\": \"I'm going to be on vacation\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://platform.thena.ai/v1/users/time-off/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2024-01-01T00:00:00.000Z\",\n \"endDate\": \"2024-01-02T23:59:59.999Z\",\n \"type\": \"VACATION\",\n \"description\": \"I'm going to be on vacation\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.thena.ai/v1/users/time-off/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2024-01-01T00:00:00.000Z\",\n \"endDate\": \"2024-01-02T23:59:59.999Z\",\n \"type\": \"VACATION\",\n \"description\": \"I'm going to be on vacation\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": {
"id": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"description": "<string>",
"type": "<string>"
}
}Users
Update your time off!
PATCH
/
v1
/
users
/
time-off
/
{id}
Update your time off!
curl --request PATCH \
--url https://platform.thena.ai/v1/users/time-off/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"startDate": "2024-01-01T00:00:00.000Z",
"endDate": "2024-01-02T23:59:59.999Z",
"type": "VACATION",
"description": "I'm going to be on vacation"
}
EOFimport requests
url = "https://platform.thena.ai/v1/users/time-off/{id}"
payload = {
"startDate": "2024-01-01T00:00:00.000Z",
"endDate": "2024-01-02T23:59:59.999Z",
"type": "VACATION",
"description": "I'm going to be on vacation"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2024-01-01T00:00:00.000Z',
endDate: '2024-01-02T23:59:59.999Z',
type: 'VACATION',
description: 'I\'m going to be on vacation'
})
};
fetch('https://platform.thena.ai/v1/users/time-off/{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://platform.thena.ai/v1/users/time-off/{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([
'startDate' => '2024-01-01T00:00:00.000Z',
'endDate' => '2024-01-02T23:59:59.999Z',
'type' => 'VACATION',
'description' => 'I\'m going to be on vacation'
]),
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://platform.thena.ai/v1/users/time-off/{id}"
payload := strings.NewReader("{\n \"startDate\": \"2024-01-01T00:00:00.000Z\",\n \"endDate\": \"2024-01-02T23:59:59.999Z\",\n \"type\": \"VACATION\",\n \"description\": \"I'm going to be on vacation\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://platform.thena.ai/v1/users/time-off/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2024-01-01T00:00:00.000Z\",\n \"endDate\": \"2024-01-02T23:59:59.999Z\",\n \"type\": \"VACATION\",\n \"description\": \"I'm going to be on vacation\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.thena.ai/v1/users/time-off/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2024-01-01T00:00:00.000Z\",\n \"endDate\": \"2024-01-02T23:59:59.999Z\",\n \"type\": \"VACATION\",\n \"description\": \"I'm going to be on vacation\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": {
"id": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"description": "<string>",
"type": "<string>"
}
}Authorizations
Enter the bearer token
Path Parameters
Body
application/json
The start date of the time off in Zulu time
Example:
"2024-01-01T00:00:00.000Z"
The end date of the time off in Zulu time
Example:
"2024-01-02T23:59:59.999Z"
The type of the time off
Example:
"VACATION"
The description of the time off
Example:
"I'm going to be on vacation"
Response
Operation successful
The status of the response
The message of the response
The timestamp of the response
The response for create/update/delete time off operations
Show child attributes
Show child attributes
⌘I