Cria calendário pré-populado com feriados nacionais (5 anos) do catálogo central. Se uf for informada, adiciona feriados estaduais daquela UF.
curl --request POST \
--url https://api.example.com/calendarios/from-template \
--header 'Content-Type: application/json' \
--data '
{
"descricao": "Calendário Goiânia"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({descricao: 'Calendário Goiânia'})
};
fetch('https://api.example.com/calendarios/from-template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/calendarios/from-template"
payload = { "descricao": "Calendário Goiânia" }
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/from-template"
payload := strings.NewReader("{\n \"descricao\": \"Calendário Goiânia\"\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/from-template",
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([
'descricao' => 'Calendário Goiânia'
]),
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/from-template")
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 \"descricao\": \"Calendário Goiânia\"\n}"
response = http.request(request)
puts response.read_body{
"calendarioId": "f8e0a0f5-4f4d-4b4f-9f8d-8f4d4f4d4f4d",
"descricao": "Calendário Unidade Goiânia",
"colaboradores": 7
}{
"service": "<string>",
"method": "<string>",
"message": "message erro"
}Calendário
Cria calendário pré-populado com feriados nacionais (5 anos) do catálogo central. Se uf for informada, adiciona feriados estaduais daquela UF.
POST
/
calendarios
/
from-template
Cria calendário pré-populado com feriados nacionais (5 anos) do catálogo central. Se uf for informada, adiciona feriados estaduais daquela UF.
curl --request POST \
--url https://api.example.com/calendarios/from-template \
--header 'Content-Type: application/json' \
--data '
{
"descricao": "Calendário Goiânia"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({descricao: 'Calendário Goiânia'})
};
fetch('https://api.example.com/calendarios/from-template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/calendarios/from-template"
payload = { "descricao": "Calendário Goiânia" }
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/from-template"
payload := strings.NewReader("{\n \"descricao\": \"Calendário Goiânia\"\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/from-template",
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([
'descricao' => 'Calendário Goiânia'
]),
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/from-template")
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 \"descricao\": \"Calendário Goiânia\"\n}"
response = http.request(request)
puts response.read_body{
"calendarioId": "f8e0a0f5-4f4d-4b4f-9f8d-8f4d4f4d4f4d",
"descricao": "Calendário Unidade Goiânia",
"colaboradores": 7
}{
"service": "<string>",
"method": "<string>",
"message": "message erro"
}Body
application/json
Nome do calendário e UF opcional (sigla 2 letras)
Nome do calendário (3 a 150 caracteres)
Example:
"Calendário Goiânia"
Sigla da UF (2 letras maiúsculas) pra adicionar feriados estaduais ao calendário. Omitir pra criar só com feriados nacionais.
Example:
"GO"
Nome da cidade — usado apenas pra log/audit; backend não filtra por cidade no catálogo (filtro municipal usa codigoIbge).
Example:
"Goiânia"
Código IBGE de 7 dígitos da capital, pra incluir feriados MUNICIPAIS no calendário. Aceito apenas pras 27 capitais brasileiras (única cobertura do free tier FeriadosAPI). Backend valida silenciosamente — se IBGE não bate com nenhum registro scope=MUNICIPAL no catálogo, calendário criado sem municipais (não erro).
Example:
5208707