Alterar um bloqueio de agenda
curl --request PATCH \
--url https://api.bydoctor.com.br/api/public/v1/calendar-blocks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"date": "2023-12-25",
"end_time": "<string>",
"reason": "<string>",
"start_time": "<string>"
}
'import requests
url = "https://api.bydoctor.com.br/api/public/v1/calendar-blocks/{id}"
payload = {
"date": "2023-12-25",
"end_time": "<string>",
"reason": "<string>",
"start_time": "<string>"
}
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({
date: '2023-12-25',
end_time: '<string>',
reason: '<string>',
start_time: '<string>'
})
};
fetch('https://api.bydoctor.com.br/api/public/v1/calendar-blocks/{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.bydoctor.com.br/api/public/v1/calendar-blocks/{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([
'date' => '2023-12-25',
'end_time' => '<string>',
'reason' => '<string>',
'start_time' => '<string>'
]),
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://api.bydoctor.com.br/api/public/v1/calendar-blocks/{id}"
payload := strings.NewReader("{\n \"date\": \"2023-12-25\",\n \"end_time\": \"<string>\",\n \"reason\": \"<string>\",\n \"start_time\": \"<string>\"\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://api.bydoctor.com.br/api/public/v1/calendar-blocks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"date\": \"2023-12-25\",\n \"end_time\": \"<string>\",\n \"reason\": \"<string>\",\n \"start_time\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bydoctor.com.br/api/public/v1/calendar-blocks/{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 \"date\": \"2023-12-25\",\n \"end_time\": \"<string>\",\n \"reason\": \"<string>\",\n \"start_time\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"active": true,
"created_at": "2023-11-07T05:31:56Z",
"date": "2023-12-25",
"end_time": "<string>",
"id": 123,
"professional_id": 123,
"reason": "<string>",
"start_time": "<string>",
"type": "full_day",
"updated_at": "2023-11-07T05:31:56Z"
}calendar-blocks
Alterar um bloqueio de agenda
Altera apenas os campos enviados; reason: null apaga o motivo. Já null em start_time ou end_time é ignorado, e num bloqueio full_day os horários enviados também são ignorados. Um bloqueio desativado responde 409 com code calendar_block_inactive: só o aplicativo o reativa. Requer o escopo calendar_blocks:write.
PATCH
/
api
/
public
/
v1
/
calendar-blocks
/
{id}
Alterar um bloqueio de agenda
curl --request PATCH \
--url https://api.bydoctor.com.br/api/public/v1/calendar-blocks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"date": "2023-12-25",
"end_time": "<string>",
"reason": "<string>",
"start_time": "<string>"
}
'import requests
url = "https://api.bydoctor.com.br/api/public/v1/calendar-blocks/{id}"
payload = {
"date": "2023-12-25",
"end_time": "<string>",
"reason": "<string>",
"start_time": "<string>"
}
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({
date: '2023-12-25',
end_time: '<string>',
reason: '<string>',
start_time: '<string>'
})
};
fetch('https://api.bydoctor.com.br/api/public/v1/calendar-blocks/{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.bydoctor.com.br/api/public/v1/calendar-blocks/{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([
'date' => '2023-12-25',
'end_time' => '<string>',
'reason' => '<string>',
'start_time' => '<string>'
]),
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://api.bydoctor.com.br/api/public/v1/calendar-blocks/{id}"
payload := strings.NewReader("{\n \"date\": \"2023-12-25\",\n \"end_time\": \"<string>\",\n \"reason\": \"<string>\",\n \"start_time\": \"<string>\"\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://api.bydoctor.com.br/api/public/v1/calendar-blocks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"date\": \"2023-12-25\",\n \"end_time\": \"<string>\",\n \"reason\": \"<string>\",\n \"start_time\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bydoctor.com.br/api/public/v1/calendar-blocks/{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 \"date\": \"2023-12-25\",\n \"end_time\": \"<string>\",\n \"reason\": \"<string>\",\n \"start_time\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"active": true,
"created_at": "2023-11-07T05:31:56Z",
"date": "2023-12-25",
"end_time": "<string>",
"id": 123,
"professional_id": 123,
"reason": "<string>",
"start_time": "<string>",
"type": "full_day",
"updated_at": "2023-11-07T05:31:56Z"
}Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Corpo para alterar um bloqueio de agenda. Envie apenas os campos que mudam.
Response
200 - application/json
Bloqueio de agenda: um dia inteiro ou um intervalo em que o profissional não atende.