Appointments
Create an appointment
POST
/
appointments
cURL
curl --request POST \
--url https://api.caspen.com/v1/appointments \
--header 'Content-Type: application/json' \
--data '
{
"location_id": 123,
"practitioner_id": 123,
"service_id": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"client_ids": [
123
],
"buffer_before_duration": 60,
"buffer_after_duration": 60,
"note": "<string>",
"room_id": 123,
"vehicle_id": 123,
"travel": true,
"travel_name": "<string>",
"travel_price": 1,
"travel_before_duration": 300,
"travel_after_duration": 300,
"travel_address": "<string>",
"repeating_rule": {
"frequency": "weekly",
"interval": 2,
"days": [],
"occurrences": 50,
"skip_conflicts": true
},
"resource_ids": [
123
],
"travel_expenses": [
{
"name": "<string>",
"price": 1,
"quantity": 499999.995
}
],
"transports": [
{
"name": "<string>",
"price": 1,
"quantity": 499999.995
}
]
}
'import requests
url = "https://api.caspen.com/v1/appointments"
payload = {
"location_id": 123,
"practitioner_id": 123,
"service_id": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"client_ids": [123],
"buffer_before_duration": 60,
"buffer_after_duration": 60,
"note": "<string>",
"room_id": 123,
"vehicle_id": 123,
"travel": True,
"travel_name": "<string>",
"travel_price": 1,
"travel_before_duration": 300,
"travel_after_duration": 300,
"travel_address": "<string>",
"repeating_rule": {
"frequency": "weekly",
"interval": 2,
"days": [],
"occurrences": 50,
"skip_conflicts": True
},
"resource_ids": [123],
"travel_expenses": [
{
"name": "<string>",
"price": 1,
"quantity": 499999.995
}
],
"transports": [
{
"name": "<string>",
"price": 1,
"quantity": 499999.995
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
location_id: 123,
practitioner_id: 123,
service_id: 123,
starts_at: '2023-11-07T05:31:56Z',
ends_at: '2023-11-07T05:31:56Z',
client_ids: [123],
buffer_before_duration: 60,
buffer_after_duration: 60,
note: '<string>',
room_id: 123,
vehicle_id: 123,
travel: true,
travel_name: '<string>',
travel_price: 1,
travel_before_duration: 300,
travel_after_duration: 300,
travel_address: '<string>',
repeating_rule: {
frequency: 'weekly',
interval: 2,
days: [],
occurrences: 50,
skip_conflicts: true
},
resource_ids: [123],
travel_expenses: [{name: '<string>', price: 1, quantity: 499999.995}],
transports: [{name: '<string>', price: 1, quantity: 499999.995}]
})
};
fetch('https://api.caspen.com/v1/appointments', 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.caspen.com/v1/appointments",
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([
'location_id' => 123,
'practitioner_id' => 123,
'service_id' => 123,
'starts_at' => '2023-11-07T05:31:56Z',
'ends_at' => '2023-11-07T05:31:56Z',
'client_ids' => [
123
],
'buffer_before_duration' => 60,
'buffer_after_duration' => 60,
'note' => '<string>',
'room_id' => 123,
'vehicle_id' => 123,
'travel' => true,
'travel_name' => '<string>',
'travel_price' => 1,
'travel_before_duration' => 300,
'travel_after_duration' => 300,
'travel_address' => '<string>',
'repeating_rule' => [
'frequency' => 'weekly',
'interval' => 2,
'days' => [
],
'occurrences' => 50,
'skip_conflicts' => true
],
'resource_ids' => [
123
],
'travel_expenses' => [
[
'name' => '<string>',
'price' => 1,
'quantity' => 499999.995
]
],
'transports' => [
[
'name' => '<string>',
'price' => 1,
'quantity' => 499999.995
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.caspen.com/v1/appointments"
payload := strings.NewReader("{\n \"location_id\": 123,\n \"practitioner_id\": 123,\n \"service_id\": 123,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"ends_at\": \"2023-11-07T05:31:56Z\",\n \"client_ids\": [\n 123\n ],\n \"buffer_before_duration\": 60,\n \"buffer_after_duration\": 60,\n \"note\": \"<string>\",\n \"room_id\": 123,\n \"vehicle_id\": 123,\n \"travel\": true,\n \"travel_name\": \"<string>\",\n \"travel_price\": 1,\n \"travel_before_duration\": 300,\n \"travel_after_duration\": 300,\n \"travel_address\": \"<string>\",\n \"repeating_rule\": {\n \"frequency\": \"weekly\",\n \"interval\": 2,\n \"days\": [],\n \"occurrences\": 50,\n \"skip_conflicts\": true\n },\n \"resource_ids\": [\n 123\n ],\n \"travel_expenses\": [\n {\n \"name\": \"<string>\",\n \"price\": 1,\n \"quantity\": 499999.995\n }\n ],\n \"transports\": [\n {\n \"name\": \"<string>\",\n \"price\": 1,\n \"quantity\": 499999.995\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))
}HttpResponse<String> response = Unirest.post("https://api.caspen.com/v1/appointments")
.header("Content-Type", "application/json")
.body("{\n \"location_id\": 123,\n \"practitioner_id\": 123,\n \"service_id\": 123,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"ends_at\": \"2023-11-07T05:31:56Z\",\n \"client_ids\": [\n 123\n ],\n \"buffer_before_duration\": 60,\n \"buffer_after_duration\": 60,\n \"note\": \"<string>\",\n \"room_id\": 123,\n \"vehicle_id\": 123,\n \"travel\": true,\n \"travel_name\": \"<string>\",\n \"travel_price\": 1,\n \"travel_before_duration\": 300,\n \"travel_after_duration\": 300,\n \"travel_address\": \"<string>\",\n \"repeating_rule\": {\n \"frequency\": \"weekly\",\n \"interval\": 2,\n \"days\": [],\n \"occurrences\": 50,\n \"skip_conflicts\": true\n },\n \"resource_ids\": [\n 123\n ],\n \"travel_expenses\": [\n {\n \"name\": \"<string>\",\n \"price\": 1,\n \"quantity\": 499999.995\n }\n ],\n \"transports\": [\n {\n \"name\": \"<string>\",\n \"price\": 1,\n \"quantity\": 499999.995\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.caspen.com/v1/appointments")
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 \"location_id\": 123,\n \"practitioner_id\": 123,\n \"service_id\": 123,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"ends_at\": \"2023-11-07T05:31:56Z\",\n \"client_ids\": [\n 123\n ],\n \"buffer_before_duration\": 60,\n \"buffer_after_duration\": 60,\n \"note\": \"<string>\",\n \"room_id\": 123,\n \"vehicle_id\": 123,\n \"travel\": true,\n \"travel_name\": \"<string>\",\n \"travel_price\": 1,\n \"travel_before_duration\": 300,\n \"travel_after_duration\": 300,\n \"travel_address\": \"<string>\",\n \"repeating_rule\": {\n \"frequency\": \"weekly\",\n \"interval\": 2,\n \"days\": [],\n \"occurrences\": 50,\n \"skip_conflicts\": true\n },\n \"resource_ids\": [\n 123\n ],\n \"travel_expenses\": [\n {\n \"name\": \"<string>\",\n \"price\": 1,\n \"quantity\": 499999.995\n }\n ],\n \"transports\": [\n {\n \"name\": \"<string>\",\n \"price\": 1,\n \"quantity\": 499999.995\n }\n ]\n}"
response = http.request(request)
puts response.read_body"<string>"{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Body
application/json
Minimum array length:
1Required range:
0 <= x <= 120Required range:
0 <= x <= 120Maximum string length:
255Maximum string length:
255Required range:
x >= 0Required range:
0 <= x <= 600Required range:
0 <= x <= 600Maximum string length:
500Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
The response is of type string.
⌘I
cURL
curl --request POST \
--url https://api.caspen.com/v1/appointments \
--header 'Content-Type: application/json' \
--data '
{
"location_id": 123,
"practitioner_id": 123,
"service_id": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"client_ids": [
123
],
"buffer_before_duration": 60,
"buffer_after_duration": 60,
"note": "<string>",
"room_id": 123,
"vehicle_id": 123,
"travel": true,
"travel_name": "<string>",
"travel_price": 1,
"travel_before_duration": 300,
"travel_after_duration": 300,
"travel_address": "<string>",
"repeating_rule": {
"frequency": "weekly",
"interval": 2,
"days": [],
"occurrences": 50,
"skip_conflicts": true
},
"resource_ids": [
123
],
"travel_expenses": [
{
"name": "<string>",
"price": 1,
"quantity": 499999.995
}
],
"transports": [
{
"name": "<string>",
"price": 1,
"quantity": 499999.995
}
]
}
'import requests
url = "https://api.caspen.com/v1/appointments"
payload = {
"location_id": 123,
"practitioner_id": 123,
"service_id": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"client_ids": [123],
"buffer_before_duration": 60,
"buffer_after_duration": 60,
"note": "<string>",
"room_id": 123,
"vehicle_id": 123,
"travel": True,
"travel_name": "<string>",
"travel_price": 1,
"travel_before_duration": 300,
"travel_after_duration": 300,
"travel_address": "<string>",
"repeating_rule": {
"frequency": "weekly",
"interval": 2,
"days": [],
"occurrences": 50,
"skip_conflicts": True
},
"resource_ids": [123],
"travel_expenses": [
{
"name": "<string>",
"price": 1,
"quantity": 499999.995
}
],
"transports": [
{
"name": "<string>",
"price": 1,
"quantity": 499999.995
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
location_id: 123,
practitioner_id: 123,
service_id: 123,
starts_at: '2023-11-07T05:31:56Z',
ends_at: '2023-11-07T05:31:56Z',
client_ids: [123],
buffer_before_duration: 60,
buffer_after_duration: 60,
note: '<string>',
room_id: 123,
vehicle_id: 123,
travel: true,
travel_name: '<string>',
travel_price: 1,
travel_before_duration: 300,
travel_after_duration: 300,
travel_address: '<string>',
repeating_rule: {
frequency: 'weekly',
interval: 2,
days: [],
occurrences: 50,
skip_conflicts: true
},
resource_ids: [123],
travel_expenses: [{name: '<string>', price: 1, quantity: 499999.995}],
transports: [{name: '<string>', price: 1, quantity: 499999.995}]
})
};
fetch('https://api.caspen.com/v1/appointments', 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.caspen.com/v1/appointments",
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([
'location_id' => 123,
'practitioner_id' => 123,
'service_id' => 123,
'starts_at' => '2023-11-07T05:31:56Z',
'ends_at' => '2023-11-07T05:31:56Z',
'client_ids' => [
123
],
'buffer_before_duration' => 60,
'buffer_after_duration' => 60,
'note' => '<string>',
'room_id' => 123,
'vehicle_id' => 123,
'travel' => true,
'travel_name' => '<string>',
'travel_price' => 1,
'travel_before_duration' => 300,
'travel_after_duration' => 300,
'travel_address' => '<string>',
'repeating_rule' => [
'frequency' => 'weekly',
'interval' => 2,
'days' => [
],
'occurrences' => 50,
'skip_conflicts' => true
],
'resource_ids' => [
123
],
'travel_expenses' => [
[
'name' => '<string>',
'price' => 1,
'quantity' => 499999.995
]
],
'transports' => [
[
'name' => '<string>',
'price' => 1,
'quantity' => 499999.995
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.caspen.com/v1/appointments"
payload := strings.NewReader("{\n \"location_id\": 123,\n \"practitioner_id\": 123,\n \"service_id\": 123,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"ends_at\": \"2023-11-07T05:31:56Z\",\n \"client_ids\": [\n 123\n ],\n \"buffer_before_duration\": 60,\n \"buffer_after_duration\": 60,\n \"note\": \"<string>\",\n \"room_id\": 123,\n \"vehicle_id\": 123,\n \"travel\": true,\n \"travel_name\": \"<string>\",\n \"travel_price\": 1,\n \"travel_before_duration\": 300,\n \"travel_after_duration\": 300,\n \"travel_address\": \"<string>\",\n \"repeating_rule\": {\n \"frequency\": \"weekly\",\n \"interval\": 2,\n \"days\": [],\n \"occurrences\": 50,\n \"skip_conflicts\": true\n },\n \"resource_ids\": [\n 123\n ],\n \"travel_expenses\": [\n {\n \"name\": \"<string>\",\n \"price\": 1,\n \"quantity\": 499999.995\n }\n ],\n \"transports\": [\n {\n \"name\": \"<string>\",\n \"price\": 1,\n \"quantity\": 499999.995\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))
}HttpResponse<String> response = Unirest.post("https://api.caspen.com/v1/appointments")
.header("Content-Type", "application/json")
.body("{\n \"location_id\": 123,\n \"practitioner_id\": 123,\n \"service_id\": 123,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"ends_at\": \"2023-11-07T05:31:56Z\",\n \"client_ids\": [\n 123\n ],\n \"buffer_before_duration\": 60,\n \"buffer_after_duration\": 60,\n \"note\": \"<string>\",\n \"room_id\": 123,\n \"vehicle_id\": 123,\n \"travel\": true,\n \"travel_name\": \"<string>\",\n \"travel_price\": 1,\n \"travel_before_duration\": 300,\n \"travel_after_duration\": 300,\n \"travel_address\": \"<string>\",\n \"repeating_rule\": {\n \"frequency\": \"weekly\",\n \"interval\": 2,\n \"days\": [],\n \"occurrences\": 50,\n \"skip_conflicts\": true\n },\n \"resource_ids\": [\n 123\n ],\n \"travel_expenses\": [\n {\n \"name\": \"<string>\",\n \"price\": 1,\n \"quantity\": 499999.995\n }\n ],\n \"transports\": [\n {\n \"name\": \"<string>\",\n \"price\": 1,\n \"quantity\": 499999.995\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.caspen.com/v1/appointments")
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 \"location_id\": 123,\n \"practitioner_id\": 123,\n \"service_id\": 123,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"ends_at\": \"2023-11-07T05:31:56Z\",\n \"client_ids\": [\n 123\n ],\n \"buffer_before_duration\": 60,\n \"buffer_after_duration\": 60,\n \"note\": \"<string>\",\n \"room_id\": 123,\n \"vehicle_id\": 123,\n \"travel\": true,\n \"travel_name\": \"<string>\",\n \"travel_price\": 1,\n \"travel_before_duration\": 300,\n \"travel_after_duration\": 300,\n \"travel_address\": \"<string>\",\n \"repeating_rule\": {\n \"frequency\": \"weekly\",\n \"interval\": 2,\n \"days\": [],\n \"occurrences\": 50,\n \"skip_conflicts\": true\n },\n \"resource_ids\": [\n 123\n ],\n \"travel_expenses\": [\n {\n \"name\": \"<string>\",\n \"price\": 1,\n \"quantity\": 499999.995\n }\n ],\n \"transports\": [\n {\n \"name\": \"<string>\",\n \"price\": 1,\n \"quantity\": 499999.995\n }\n ]\n}"
response = http.request(request)
puts response.read_body"<string>"{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}