Doctor day off (cancel the day)
curl --request POST \
--url https://docistra.com/api/v1/doctors/{id}/days/{date}/off \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Doctor is sick",
"cancel_bookings": true
}
'import requests
url = "https://docistra.com/api/v1/doctors/{id}/days/{date}/off"
payload = {
"reason": "Doctor is sick",
"cancel_bookings": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Doctor is sick', cancel_bookings: true})
};
fetch('https://docistra.com/api/v1/doctors/{id}/days/{date}/off', 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://docistra.com/api/v1/doctors/{id}/days/{date}/off",
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([
'reason' => 'Doctor is sick',
'cancel_bookings' => true
]),
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://docistra.com/api/v1/doctors/{id}/days/{date}/off"
payload := strings.NewReader("{\n \"reason\": \"Doctor is sick\",\n \"cancel_bookings\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://docistra.com/api/v1/doctors/{id}/days/{date}/off")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Doctor is sick\",\n \"cancel_bookings\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docistra.com/api/v1/doctors/{id}/days/{date}/off")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Doctor is sick\",\n \"cancel_bookings\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"doctor_id": "<string>",
"date": "2023-12-25",
"branch_ids": [
"<string>"
],
"cancelled": [
{
"appointment_id": "<string>",
"patient_id": "<string>",
"patient_notified": {
"via": "whatsapp_text",
"reason": "<string>"
}
}
],
"not_cancelled": [
{
"appointment_id": "<string>",
"patient_id": "<string>",
"error": "paid_locked"
}
],
"kept": [
{
"appointment_id": "<string>",
"patient_id": "<string>"
}
]
}
}Doctor schedule
Doctor day off (cancel the day)
The doctor won’t come. The day is closed at the given branch (or every branch), so nobody can book it. With cancel_bookings (default) every reserved booking that day is cancelled and each patient is messaged on WhatsApp (SMS when WhatsApp can’t reach them). Paid visits are not cancelled and come back in not_cancelled. With cancel_bookings: false the bookings stay and each patient is asked to pick another time.
POST
/
doctors
/
{id}
/
days
/
{date}
/
off
Doctor day off (cancel the day)
curl --request POST \
--url https://docistra.com/api/v1/doctors/{id}/days/{date}/off \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Doctor is sick",
"cancel_bookings": true
}
'import requests
url = "https://docistra.com/api/v1/doctors/{id}/days/{date}/off"
payload = {
"reason": "Doctor is sick",
"cancel_bookings": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Doctor is sick', cancel_bookings: true})
};
fetch('https://docistra.com/api/v1/doctors/{id}/days/{date}/off', 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://docistra.com/api/v1/doctors/{id}/days/{date}/off",
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([
'reason' => 'Doctor is sick',
'cancel_bookings' => true
]),
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://docistra.com/api/v1/doctors/{id}/days/{date}/off"
payload := strings.NewReader("{\n \"reason\": \"Doctor is sick\",\n \"cancel_bookings\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://docistra.com/api/v1/doctors/{id}/days/{date}/off")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Doctor is sick\",\n \"cancel_bookings\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docistra.com/api/v1/doctors/{id}/days/{date}/off")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Doctor is sick\",\n \"cancel_bookings\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"doctor_id": "<string>",
"date": "2023-12-25",
"branch_ids": [
"<string>"
],
"cancelled": [
{
"appointment_id": "<string>",
"patient_id": "<string>",
"patient_notified": {
"via": "whatsapp_text",
"reason": "<string>"
}
}
],
"not_cancelled": [
{
"appointment_id": "<string>",
"patient_id": "<string>",
"error": "paid_locked"
}
],
"kept": [
{
"appointment_id": "<string>",
"patient_id": "<string>"
}
]
}
}Authorizations
Headers
Path Parameters
Body
application/json