Criar varios feriados em uma requisição
curl --request POST \
--url https://api.example.com/calendarios/{calendarioId}/feriados \
--header 'Content-Type: application/json' \
--data '
{
"feriados": [
{
"descricao": "Natal",
"data": "2024-12-25",
"recorrencia": true,
"periodo": "INTEIRO"
}
]
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
feriados: [
{descricao: 'Natal', data: '2024-12-25', recorrencia: true, periodo: 'INTEIRO'}
]
})
};
fetch('https://api.example.com/calendarios/{calendarioId}/feriados', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/calendarios/{calendarioId}/feriados"
payload = { "feriados": [
{
"descricao": "Natal",
"data": "2024-12-25",
"recorrencia": True,
"periodo": "INTEIRO"
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/calendarios/{calendarioId}/feriados"
payload := strings.NewReader("{\n \"feriados\": [\n {\n \"descricao\": \"Natal\",\n \"data\": \"2024-12-25\",\n \"recorrencia\": true,\n \"periodo\": \"INTEIRO\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/calendarios/{calendarioId}/feriados",
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([
'feriados' => [
[
'descricao' => 'Natal',
'data' => '2024-12-25',
'recorrencia' => true,
'periodo' => 'INTEIRO'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.example.com/calendarios/{calendarioId}/feriados")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"feriados\": [\n {\n \"descricao\": \"Natal\",\n \"data\": \"2024-12-25\",\n \"recorrencia\": true,\n \"periodo\": \"INTEIRO\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"calendarioId": "f8e0a0f5-4f4d-4b4f-9f8d-8f4d4f4d4f4d",
"descricao": "Calendário Unidade Goiânia",
"colaboradores": 7,
"feriados": [
{
"feriadoId": "f8e0a0f5-4f4d-4b4f-9f8d-8f4d4f4d4f4d",
"descricao": "Natal",
"data": "2024-12-25",
"diaSemana": "Quarta-feira",
"recorrencia": true,
"periodo": "INTEIRO"
}
]
}{
"service": "<string>",
"method": "<string>",
"message": "message erro"
}Calendário
Criar varios feriados em uma requisição
POST
/
calendarios
/
{calendarioId}
/
feriados
Criar varios feriados em uma requisição
curl --request POST \
--url https://api.example.com/calendarios/{calendarioId}/feriados \
--header 'Content-Type: application/json' \
--data '
{
"feriados": [
{
"descricao": "Natal",
"data": "2024-12-25",
"recorrencia": true,
"periodo": "INTEIRO"
}
]
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
feriados: [
{descricao: 'Natal', data: '2024-12-25', recorrencia: true, periodo: 'INTEIRO'}
]
})
};
fetch('https://api.example.com/calendarios/{calendarioId}/feriados', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/calendarios/{calendarioId}/feriados"
payload = { "feriados": [
{
"descricao": "Natal",
"data": "2024-12-25",
"recorrencia": True,
"periodo": "INTEIRO"
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/calendarios/{calendarioId}/feriados"
payload := strings.NewReader("{\n \"feriados\": [\n {\n \"descricao\": \"Natal\",\n \"data\": \"2024-12-25\",\n \"recorrencia\": true,\n \"periodo\": \"INTEIRO\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/calendarios/{calendarioId}/feriados",
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([
'feriados' => [
[
'descricao' => 'Natal',
'data' => '2024-12-25',
'recorrencia' => true,
'periodo' => 'INTEIRO'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.example.com/calendarios/{calendarioId}/feriados")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"feriados\": [\n {\n \"descricao\": \"Natal\",\n \"data\": \"2024-12-25\",\n \"recorrencia\": true,\n \"periodo\": \"INTEIRO\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"calendarioId": "f8e0a0f5-4f4d-4b4f-9f8d-8f4d4f4d4f4d",
"descricao": "Calendário Unidade Goiânia",
"colaboradores": 7,
"feriados": [
{
"feriadoId": "f8e0a0f5-4f4d-4b4f-9f8d-8f4d4f4d4f4d",
"descricao": "Natal",
"data": "2024-12-25",
"diaSemana": "Quarta-feira",
"recorrencia": true,
"periodo": "INTEIRO"
}
]
}{
"service": "<string>",
"method": "<string>",
"message": "message erro"
}Path Parameters
ID do calendario
Body
application/json
Array de feriado
Lista de feriados do calendário
Show child attributes
Show child attributes
Response
Feriados criados com sucesso
Identificador do calendário
Example:
"f8e0a0f5-4f4d-4b4f-9f8d-8f4d4f4d4f4d"
Nome do calendário
Example:
"Calendário Unidade Goiânia"
Número de colaboradores vinculados
Example:
7
Lista de feriados do calendário
Show child attributes
Show child attributes