curl --request PUT \
--url https://api.absentify.com/api/v1/members/{member_id}/out-of-office-settings/{leave_type_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"internalReplyMessage": "<string>",
"externalReplyMessage": "<string>",
"sync_enabled": true,
"allow_member_edit_out_of_office_message": true
}
'import requests
url = "https://api.absentify.com/api/v1/members/{member_id}/out-of-office-settings/{leave_type_id}"
payload = {
"internalReplyMessage": "<string>",
"externalReplyMessage": "<string>",
"sync_enabled": True,
"allow_member_edit_out_of_office_message": True
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
internalReplyMessage: '<string>',
externalReplyMessage: '<string>',
sync_enabled: true,
allow_member_edit_out_of_office_message: true
})
};
fetch('https://api.absentify.com/api/v1/members/{member_id}/out-of-office-settings/{leave_type_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://api.absentify.com/api/v1/members/{member_id}/out-of-office-settings/{leave_type_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'internalReplyMessage' => '<string>',
'externalReplyMessage' => '<string>',
'sync_enabled' => true,
'allow_member_edit_out_of_office_message' => true
]),
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}/out-of-office-settings/{leave_type_id}"
payload := strings.NewReader("{\n \"internalReplyMessage\": \"<string>\",\n \"externalReplyMessage\": \"<string>\",\n \"sync_enabled\": true,\n \"allow_member_edit_out_of_office_message\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.absentify.com/api/v1/members/{member_id}/out-of-office-settings/{leave_type_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"internalReplyMessage\": \"<string>\",\n \"externalReplyMessage\": \"<string>\",\n \"sync_enabled\": true,\n \"allow_member_edit_out_of_office_message\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/members/{member_id}/out-of-office-settings/{leave_type_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"internalReplyMessage\": \"<string>\",\n \"externalReplyMessage\": \"<string>\",\n \"sync_enabled\": true,\n \"allow_member_edit_out_of_office_message\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"member_id": "<string>",
"leave_type_id": "<string>",
"internalReplyMessage": "<string>",
"externalReplyMessage": "<string>",
"externalAudience": "none",
"allow_member_edit_out_of_office_message": true,
"sync_enabled": true,
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Create or update a member's out of office message
Sets the out of office message absentify puts into the member’s mailbox while they are absent with this leave type. The call creates the setting if none exists yet and otherwise updates it, so an integration can send the same request repeatedly. The message is an initial value: the member can still edit it in absentify unless you send allow_member_edit_out_of_office_message: false. Omitted optional fields keep their current value on an existing setting, and default to true on a newly created one. Both messages accept the same placeholders as the absentify user interface and are limited to 128000 characters each, counted after absentify adds the formatting Outlook needs and with room for the footer. Requires the mailbox permission to be granted for the workspace, and the member to have a linked Microsoft account.
curl --request PUT \
--url https://api.absentify.com/api/v1/members/{member_id}/out-of-office-settings/{leave_type_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"internalReplyMessage": "<string>",
"externalReplyMessage": "<string>",
"sync_enabled": true,
"allow_member_edit_out_of_office_message": true
}
'import requests
url = "https://api.absentify.com/api/v1/members/{member_id}/out-of-office-settings/{leave_type_id}"
payload = {
"internalReplyMessage": "<string>",
"externalReplyMessage": "<string>",
"sync_enabled": True,
"allow_member_edit_out_of_office_message": True
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
internalReplyMessage: '<string>',
externalReplyMessage: '<string>',
sync_enabled: true,
allow_member_edit_out_of_office_message: true
})
};
fetch('https://api.absentify.com/api/v1/members/{member_id}/out-of-office-settings/{leave_type_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://api.absentify.com/api/v1/members/{member_id}/out-of-office-settings/{leave_type_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'internalReplyMessage' => '<string>',
'externalReplyMessage' => '<string>',
'sync_enabled' => true,
'allow_member_edit_out_of_office_message' => true
]),
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}/out-of-office-settings/{leave_type_id}"
payload := strings.NewReader("{\n \"internalReplyMessage\": \"<string>\",\n \"externalReplyMessage\": \"<string>\",\n \"sync_enabled\": true,\n \"allow_member_edit_out_of_office_message\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.absentify.com/api/v1/members/{member_id}/out-of-office-settings/{leave_type_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"internalReplyMessage\": \"<string>\",\n \"externalReplyMessage\": \"<string>\",\n \"sync_enabled\": true,\n \"allow_member_edit_out_of_office_message\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.absentify.com/api/v1/members/{member_id}/out-of-office-settings/{leave_type_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"internalReplyMessage\": \"<string>\",\n \"externalReplyMessage\": \"<string>\",\n \"sync_enabled\": true,\n \"allow_member_edit_out_of_office_message\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"member_id": "<string>",
"leave_type_id": "<string>",
"internalReplyMessage": "<string>",
"externalReplyMessage": "<string>",
"externalAudience": "none",
"allow_member_edit_out_of_office_message": true,
"sync_enabled": true,
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Path Parameters
Body
Response
Successful response
Was this page helpful?