Replace weekly hours
curl --request PUT \
--url https://docistra.com/api/v1/doctors/{id}/hours \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branches": [
{
"branch_id": "<string>",
"mode": "time",
"days": [
{
"day_of_week": 3,
"start": "16:00",
"end": "22:00",
"max_queue": 123
}
]
}
]
}
'import requests
url = "https://docistra.com/api/v1/doctors/{id}/hours"
payload = { "branches": [
{
"branch_id": "<string>",
"mode": "time",
"days": [
{
"day_of_week": 3,
"start": "16:00",
"end": "22:00",
"max_queue": 123
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branches: [
{
branch_id: '<string>',
mode: 'time',
days: [{day_of_week: 3, start: '16:00', end: '22:00', max_queue: 123}]
}
]
})
};
fetch('https://docistra.com/api/v1/doctors/{id}/hours', 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}/hours",
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([
'branches' => [
[
'branch_id' => '<string>',
'mode' => 'time',
'days' => [
[
'day_of_week' => 3,
'start' => '16:00',
'end' => '22:00',
'max_queue' => 123
]
]
]
]
]),
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}/hours"
payload := strings.NewReader("{\n \"branches\": [\n {\n \"branch_id\": \"<string>\",\n \"mode\": \"time\",\n \"days\": [\n {\n \"day_of_week\": 3,\n \"start\": \"16:00\",\n \"end\": \"22:00\",\n \"max_queue\": 123\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://docistra.com/api/v1/doctors/{id}/hours")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"branches\": [\n {\n \"branch_id\": \"<string>\",\n \"mode\": \"time\",\n \"days\": [\n {\n \"day_of_week\": 3,\n \"start\": \"16:00\",\n \"end\": \"22:00\",\n \"max_queue\": 123\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docistra.com/api/v1/doctors/{id}/hours")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"branches\": [\n {\n \"branch_id\": \"<string>\",\n \"mode\": \"time\",\n \"days\": [\n {\n \"day_of_week\": 3,\n \"start\": \"16:00\",\n \"end\": \"22:00\",\n \"max_queue\": 123\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"doctor_id": "<string>",
"branches": [
{
"branch_id": "<string>",
"branch_external_id": "<string>",
"mode": "<string>",
"days": [
{
"day_of_week": 123,
"start": "<string>",
"end": "<string>",
"max_queue": 123
}
]
}
]
}
}{
"error": "slot_taken"
}Doctor schedule
Replace weekly hours
Replaces the hours at each listed branch (a branch with no days = not working there). Only when your system is the master record. If the new hours would leave booked patients outside them: 409 has_booked_patients with their appointment ids; move or cancel those first.
PUT
/
doctors
/
{id}
/
hours
Replace weekly hours
curl --request PUT \
--url https://docistra.com/api/v1/doctors/{id}/hours \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branches": [
{
"branch_id": "<string>",
"mode": "time",
"days": [
{
"day_of_week": 3,
"start": "16:00",
"end": "22:00",
"max_queue": 123
}
]
}
]
}
'import requests
url = "https://docistra.com/api/v1/doctors/{id}/hours"
payload = { "branches": [
{
"branch_id": "<string>",
"mode": "time",
"days": [
{
"day_of_week": 3,
"start": "16:00",
"end": "22:00",
"max_queue": 123
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branches: [
{
branch_id: '<string>',
mode: 'time',
days: [{day_of_week: 3, start: '16:00', end: '22:00', max_queue: 123}]
}
]
})
};
fetch('https://docistra.com/api/v1/doctors/{id}/hours', 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}/hours",
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([
'branches' => [
[
'branch_id' => '<string>',
'mode' => 'time',
'days' => [
[
'day_of_week' => 3,
'start' => '16:00',
'end' => '22:00',
'max_queue' => 123
]
]
]
]
]),
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}/hours"
payload := strings.NewReader("{\n \"branches\": [\n {\n \"branch_id\": \"<string>\",\n \"mode\": \"time\",\n \"days\": [\n {\n \"day_of_week\": 3,\n \"start\": \"16:00\",\n \"end\": \"22:00\",\n \"max_queue\": 123\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://docistra.com/api/v1/doctors/{id}/hours")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"branches\": [\n {\n \"branch_id\": \"<string>\",\n \"mode\": \"time\",\n \"days\": [\n {\n \"day_of_week\": 3,\n \"start\": \"16:00\",\n \"end\": \"22:00\",\n \"max_queue\": 123\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docistra.com/api/v1/doctors/{id}/hours")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"branches\": [\n {\n \"branch_id\": \"<string>\",\n \"mode\": \"time\",\n \"days\": [\n {\n \"day_of_week\": 3,\n \"start\": \"16:00\",\n \"end\": \"22:00\",\n \"max_queue\": 123\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"doctor_id": "<string>",
"branches": [
{
"branch_id": "<string>",
"branch_external_id": "<string>",
"mode": "<string>",
"days": [
{
"day_of_week": 123,
"start": "<string>",
"end": "<string>",
"max_queue": 123
}
]
}
]
}
}{
"error": "slot_taken"
}