Update Booking
curl --request PUT \
--url https://api.sonderplan.com/v2/booking \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"name": "Test Booking",
"start": 1547501100,
"end": 1547538900,
"start_date_time_iso": "2022-02-22T09:00:00+11:00",
"end_date_time_iso": "2022-02-22T17:00:00+11:00",
"all_day": "false",
"notes": "Additional note",
"repeat_master": "true",
"repeat_master_id": "0",
"repeat_rule": "FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;",
"resources": [
{
"id": 9458,
"rates": [
{
"rate_scheme_id": 984312,
"rate_scheme_name": "Resource Rate",
"currency": "AUD",
"buy": {
"unit": "hourly",
"unit_amount": "20.65",
"quantity": "2.4",
"discount": "20.00%"
},
"sell": {
"unit": "hourly",
"unit_amount": "20.65",
"quantity": "2.4",
"discount": "20.00%"
}
}
],
"time_entries": [
{
"name": "Colour Grading",
"description": "Opening scenes completed",
"start": 1547501100,
"end": 1547538900
}
]
}
],
"project": [
{
"id": 2342354,
"start": 1547501100,
"end": 1547538900
}
],
"client": [
{
"uuid": "p4",
"contact_person": {
"id": 2837
}
}
],
"status": [
{
"name": "Second Hold",
"description": "Has second priority if the first hold cancels",
"notification": true
}
],
"billable_items": [
{
"name": "NAS Storage",
"id": 2342354,
"description": "Rented per TB, per month",
"cost": "25.23",
"buy_cost": "20",
"currency": "AUD",
"quantity": "4",
"billable_item_id": 897832,
"taxes": [
{
"id": 3247,
"name": "GST",
"rate": "10.00",
"total": "151.00"
}
],
"create_new": true
}
],
"custom_fields": [
{
"id": 7823,
"name": "Type",
"value": "Video Editing",
"value_id": 8973,
"update_key": "2_1_7823"
}
]
}
'import requests
url = "https://api.sonderplan.com/v2/booking"
payload = {
"id": 1,
"name": "Test Booking",
"start": 1547501100,
"end": 1547538900,
"start_date_time_iso": "2022-02-22T09:00:00+11:00",
"end_date_time_iso": "2022-02-22T17:00:00+11:00",
"all_day": "false",
"notes": "Additional note",
"repeat_master": "true",
"repeat_master_id": "0",
"repeat_rule": "FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;",
"resources": [
{
"id": 9458,
"rates": [
{
"rate_scheme_id": 984312,
"rate_scheme_name": "Resource Rate",
"currency": "AUD",
"buy": {
"unit": "hourly",
"unit_amount": "20.65",
"quantity": "2.4",
"discount": "20.00%"
},
"sell": {
"unit": "hourly",
"unit_amount": "20.65",
"quantity": "2.4",
"discount": "20.00%"
}
}
],
"time_entries": [
{
"name": "Colour Grading",
"description": "Opening scenes completed",
"start": 1547501100,
"end": 1547538900
}
]
}
],
"project": [
{
"id": 2342354,
"start": 1547501100,
"end": 1547538900
}
],
"client": [
{
"uuid": "p4",
"contact_person": { "id": 2837 }
}
],
"status": [
{
"name": "Second Hold",
"description": "Has second priority if the first hold cancels",
"notification": True
}
],
"billable_items": [
{
"name": "NAS Storage",
"id": 2342354,
"description": "Rented per TB, per month",
"cost": "25.23",
"buy_cost": "20",
"currency": "AUD",
"quantity": "4",
"billable_item_id": 897832,
"taxes": [
{
"id": 3247,
"name": "GST",
"rate": "10.00",
"total": "151.00"
}
],
"create_new": True
}
],
"custom_fields": [
{
"id": 7823,
"name": "Type",
"value": "Video Editing",
"value_id": 8973,
"update_key": "2_1_7823"
}
]
}
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({
id: 1,
name: 'Test Booking',
start: 1547501100,
end: 1547538900,
start_date_time_iso: '2022-02-22T09:00:00+11:00',
end_date_time_iso: '2022-02-22T17:00:00+11:00',
all_day: 'false',
notes: 'Additional note',
repeat_master: 'true',
repeat_master_id: '0',
repeat_rule: 'FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;',
resources: [
{
id: 9458,
rates: [
{
rate_scheme_id: 984312,
rate_scheme_name: 'Resource Rate',
currency: 'AUD',
buy: {unit: 'hourly', unit_amount: '20.65', quantity: '2.4', discount: '20.00%'},
sell: {unit: 'hourly', unit_amount: '20.65', quantity: '2.4', discount: '20.00%'}
}
],
time_entries: [
{
name: 'Colour Grading',
description: 'Opening scenes completed',
start: 1547501100,
end: 1547538900
}
]
}
],
project: [{id: 2342354, start: 1547501100, end: 1547538900}],
client: [{uuid: 'p4', contact_person: {id: 2837}}],
status: [
{
name: 'Second Hold',
description: 'Has second priority if the first hold cancels',
notification: true
}
],
billable_items: [
{
name: 'NAS Storage',
id: 2342354,
description: 'Rented per TB, per month',
cost: '25.23',
buy_cost: '20',
currency: 'AUD',
quantity: '4',
billable_item_id: 897832,
taxes: [{id: 3247, name: 'GST', rate: '10.00', total: '151.00'}],
create_new: true
}
],
custom_fields: [
{
id: 7823,
name: 'Type',
value: 'Video Editing',
value_id: 8973,
update_key: '2_1_7823'
}
]
})
};
fetch('https://api.sonderplan.com/v2/booking', 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.sonderplan.com/v2/booking",
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([
'id' => 1,
'name' => 'Test Booking',
'start' => 1547501100,
'end' => 1547538900,
'start_date_time_iso' => '2022-02-22T09:00:00+11:00',
'end_date_time_iso' => '2022-02-22T17:00:00+11:00',
'all_day' => 'false',
'notes' => 'Additional note',
'repeat_master' => 'true',
'repeat_master_id' => '0',
'repeat_rule' => 'FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;',
'resources' => [
[
'id' => 9458,
'rates' => [
[
'rate_scheme_id' => 984312,
'rate_scheme_name' => 'Resource Rate',
'currency' => 'AUD',
'buy' => [
'unit' => 'hourly',
'unit_amount' => '20.65',
'quantity' => '2.4',
'discount' => '20.00%'
],
'sell' => [
'unit' => 'hourly',
'unit_amount' => '20.65',
'quantity' => '2.4',
'discount' => '20.00%'
]
]
],
'time_entries' => [
[
'name' => 'Colour Grading',
'description' => 'Opening scenes completed',
'start' => 1547501100,
'end' => 1547538900
]
]
]
],
'project' => [
[
'id' => 2342354,
'start' => 1547501100,
'end' => 1547538900
]
],
'client' => [
[
'uuid' => 'p4',
'contact_person' => [
'id' => 2837
]
]
],
'status' => [
[
'name' => 'Second Hold',
'description' => 'Has second priority if the first hold cancels',
'notification' => true
]
],
'billable_items' => [
[
'name' => 'NAS Storage',
'id' => 2342354,
'description' => 'Rented per TB, per month',
'cost' => '25.23',
'buy_cost' => '20',
'currency' => 'AUD',
'quantity' => '4',
'billable_item_id' => 897832,
'taxes' => [
[
'id' => 3247,
'name' => 'GST',
'rate' => '10.00',
'total' => '151.00'
]
],
'create_new' => true
]
],
'custom_fields' => [
[
'id' => 7823,
'name' => 'Type',
'value' => 'Video Editing',
'value_id' => 8973,
'update_key' => '2_1_7823'
]
]
]),
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.sonderplan.com/v2/booking"
payload := strings.NewReader("{\n \"id\": 1,\n \"name\": \"Test Booking\",\n \"start\": 1547501100,\n \"end\": 1547538900,\n \"start_date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"end_date_time_iso\": \"2022-02-22T17:00:00+11:00\",\n \"all_day\": \"false\",\n \"notes\": \"Additional note\",\n \"repeat_master\": \"true\",\n \"repeat_master_id\": \"0\",\n \"repeat_rule\": \"FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;\",\n \"resources\": [\n {\n \"id\": 9458,\n \"rates\": [\n {\n \"rate_scheme_id\": 984312,\n \"rate_scheme_name\": \"Resource Rate\",\n \"currency\": \"AUD\",\n \"buy\": {\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"quantity\": \"2.4\",\n \"discount\": \"20.00%\"\n },\n \"sell\": {\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"quantity\": \"2.4\",\n \"discount\": \"20.00%\"\n }\n }\n ],\n \"time_entries\": [\n {\n \"name\": \"Colour Grading\",\n \"description\": \"Opening scenes completed\",\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ]\n }\n ],\n \"project\": [\n {\n \"id\": 2342354,\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ],\n \"client\": [\n {\n \"uuid\": \"p4\",\n \"contact_person\": {\n \"id\": 2837\n }\n }\n ],\n \"status\": [\n {\n \"name\": \"Second Hold\",\n \"description\": \"Has second priority if the first hold cancels\",\n \"notification\": true\n }\n ],\n \"billable_items\": [\n {\n \"name\": \"NAS Storage\",\n \"id\": 2342354,\n \"description\": \"Rented per TB, per month\",\n \"cost\": \"25.23\",\n \"buy_cost\": \"20\",\n \"currency\": \"AUD\",\n \"quantity\": \"4\",\n \"billable_item_id\": 897832,\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\n }\n ],\n \"create_new\": true\n }\n ],\n \"custom_fields\": [\n {\n \"id\": 7823,\n \"name\": \"Type\",\n \"value\": \"Video Editing\",\n \"value_id\": 8973,\n \"update_key\": \"2_1_7823\"\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://api.sonderplan.com/v2/booking")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"name\": \"Test Booking\",\n \"start\": 1547501100,\n \"end\": 1547538900,\n \"start_date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"end_date_time_iso\": \"2022-02-22T17:00:00+11:00\",\n \"all_day\": \"false\",\n \"notes\": \"Additional note\",\n \"repeat_master\": \"true\",\n \"repeat_master_id\": \"0\",\n \"repeat_rule\": \"FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;\",\n \"resources\": [\n {\n \"id\": 9458,\n \"rates\": [\n {\n \"rate_scheme_id\": 984312,\n \"rate_scheme_name\": \"Resource Rate\",\n \"currency\": \"AUD\",\n \"buy\": {\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"quantity\": \"2.4\",\n \"discount\": \"20.00%\"\n },\n \"sell\": {\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"quantity\": \"2.4\",\n \"discount\": \"20.00%\"\n }\n }\n ],\n \"time_entries\": [\n {\n \"name\": \"Colour Grading\",\n \"description\": \"Opening scenes completed\",\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ]\n }\n ],\n \"project\": [\n {\n \"id\": 2342354,\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ],\n \"client\": [\n {\n \"uuid\": \"p4\",\n \"contact_person\": {\n \"id\": 2837\n }\n }\n ],\n \"status\": [\n {\n \"name\": \"Second Hold\",\n \"description\": \"Has second priority if the first hold cancels\",\n \"notification\": true\n }\n ],\n \"billable_items\": [\n {\n \"name\": \"NAS Storage\",\n \"id\": 2342354,\n \"description\": \"Rented per TB, per month\",\n \"cost\": \"25.23\",\n \"buy_cost\": \"20\",\n \"currency\": \"AUD\",\n \"quantity\": \"4\",\n \"billable_item_id\": 897832,\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\n }\n ],\n \"create_new\": true\n }\n ],\n \"custom_fields\": [\n {\n \"id\": 7823,\n \"name\": \"Type\",\n \"value\": \"Video Editing\",\n \"value_id\": 8973,\n \"update_key\": \"2_1_7823\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sonderplan.com/v2/booking")
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 \"id\": 1,\n \"name\": \"Test Booking\",\n \"start\": 1547501100,\n \"end\": 1547538900,\n \"start_date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"end_date_time_iso\": \"2022-02-22T17:00:00+11:00\",\n \"all_day\": \"false\",\n \"notes\": \"Additional note\",\n \"repeat_master\": \"true\",\n \"repeat_master_id\": \"0\",\n \"repeat_rule\": \"FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;\",\n \"resources\": [\n {\n \"id\": 9458,\n \"rates\": [\n {\n \"rate_scheme_id\": 984312,\n \"rate_scheme_name\": \"Resource Rate\",\n \"currency\": \"AUD\",\n \"buy\": {\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"quantity\": \"2.4\",\n \"discount\": \"20.00%\"\n },\n \"sell\": {\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"quantity\": \"2.4\",\n \"discount\": \"20.00%\"\n }\n }\n ],\n \"time_entries\": [\n {\n \"name\": \"Colour Grading\",\n \"description\": \"Opening scenes completed\",\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ]\n }\n ],\n \"project\": [\n {\n \"id\": 2342354,\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ],\n \"client\": [\n {\n \"uuid\": \"p4\",\n \"contact_person\": {\n \"id\": 2837\n }\n }\n ],\n \"status\": [\n {\n \"name\": \"Second Hold\",\n \"description\": \"Has second priority if the first hold cancels\",\n \"notification\": true\n }\n ],\n \"billable_items\": [\n {\n \"name\": \"NAS Storage\",\n \"id\": 2342354,\n \"description\": \"Rented per TB, per month\",\n \"cost\": \"25.23\",\n \"buy_cost\": \"20\",\n \"currency\": \"AUD\",\n \"quantity\": \"4\",\n \"billable_item_id\": 897832,\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\n }\n ],\n \"create_new\": true\n }\n ],\n \"custom_fields\": [\n {\n \"id\": 7823,\n \"name\": \"Type\",\n \"value\": \"Video Editing\",\n \"value_id\": 8973,\n \"update_key\": \"2_1_7823\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": {
"id": 1
}
}{
"error": {
"code": "404",
"message": "Requested resource was not found"
}
}Booking
Update Booking
WRITE access to the SCHEDULE module is required to access this endpointThe
bookingEdited webhook will be fired when this endpoint has run successfullyTo avoid generating lots of undesired notifications, take care when creating or updating bookings and consider using the
notify_user_resources option which can be used to silence notifications for end users.PUT
/
v2
/
booking
Update Booking
curl --request PUT \
--url https://api.sonderplan.com/v2/booking \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"name": "Test Booking",
"start": 1547501100,
"end": 1547538900,
"start_date_time_iso": "2022-02-22T09:00:00+11:00",
"end_date_time_iso": "2022-02-22T17:00:00+11:00",
"all_day": "false",
"notes": "Additional note",
"repeat_master": "true",
"repeat_master_id": "0",
"repeat_rule": "FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;",
"resources": [
{
"id": 9458,
"rates": [
{
"rate_scheme_id": 984312,
"rate_scheme_name": "Resource Rate",
"currency": "AUD",
"buy": {
"unit": "hourly",
"unit_amount": "20.65",
"quantity": "2.4",
"discount": "20.00%"
},
"sell": {
"unit": "hourly",
"unit_amount": "20.65",
"quantity": "2.4",
"discount": "20.00%"
}
}
],
"time_entries": [
{
"name": "Colour Grading",
"description": "Opening scenes completed",
"start": 1547501100,
"end": 1547538900
}
]
}
],
"project": [
{
"id": 2342354,
"start": 1547501100,
"end": 1547538900
}
],
"client": [
{
"uuid": "p4",
"contact_person": {
"id": 2837
}
}
],
"status": [
{
"name": "Second Hold",
"description": "Has second priority if the first hold cancels",
"notification": true
}
],
"billable_items": [
{
"name": "NAS Storage",
"id": 2342354,
"description": "Rented per TB, per month",
"cost": "25.23",
"buy_cost": "20",
"currency": "AUD",
"quantity": "4",
"billable_item_id": 897832,
"taxes": [
{
"id": 3247,
"name": "GST",
"rate": "10.00",
"total": "151.00"
}
],
"create_new": true
}
],
"custom_fields": [
{
"id": 7823,
"name": "Type",
"value": "Video Editing",
"value_id": 8973,
"update_key": "2_1_7823"
}
]
}
'import requests
url = "https://api.sonderplan.com/v2/booking"
payload = {
"id": 1,
"name": "Test Booking",
"start": 1547501100,
"end": 1547538900,
"start_date_time_iso": "2022-02-22T09:00:00+11:00",
"end_date_time_iso": "2022-02-22T17:00:00+11:00",
"all_day": "false",
"notes": "Additional note",
"repeat_master": "true",
"repeat_master_id": "0",
"repeat_rule": "FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;",
"resources": [
{
"id": 9458,
"rates": [
{
"rate_scheme_id": 984312,
"rate_scheme_name": "Resource Rate",
"currency": "AUD",
"buy": {
"unit": "hourly",
"unit_amount": "20.65",
"quantity": "2.4",
"discount": "20.00%"
},
"sell": {
"unit": "hourly",
"unit_amount": "20.65",
"quantity": "2.4",
"discount": "20.00%"
}
}
],
"time_entries": [
{
"name": "Colour Grading",
"description": "Opening scenes completed",
"start": 1547501100,
"end": 1547538900
}
]
}
],
"project": [
{
"id": 2342354,
"start": 1547501100,
"end": 1547538900
}
],
"client": [
{
"uuid": "p4",
"contact_person": { "id": 2837 }
}
],
"status": [
{
"name": "Second Hold",
"description": "Has second priority if the first hold cancels",
"notification": True
}
],
"billable_items": [
{
"name": "NAS Storage",
"id": 2342354,
"description": "Rented per TB, per month",
"cost": "25.23",
"buy_cost": "20",
"currency": "AUD",
"quantity": "4",
"billable_item_id": 897832,
"taxes": [
{
"id": 3247,
"name": "GST",
"rate": "10.00",
"total": "151.00"
}
],
"create_new": True
}
],
"custom_fields": [
{
"id": 7823,
"name": "Type",
"value": "Video Editing",
"value_id": 8973,
"update_key": "2_1_7823"
}
]
}
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({
id: 1,
name: 'Test Booking',
start: 1547501100,
end: 1547538900,
start_date_time_iso: '2022-02-22T09:00:00+11:00',
end_date_time_iso: '2022-02-22T17:00:00+11:00',
all_day: 'false',
notes: 'Additional note',
repeat_master: 'true',
repeat_master_id: '0',
repeat_rule: 'FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;',
resources: [
{
id: 9458,
rates: [
{
rate_scheme_id: 984312,
rate_scheme_name: 'Resource Rate',
currency: 'AUD',
buy: {unit: 'hourly', unit_amount: '20.65', quantity: '2.4', discount: '20.00%'},
sell: {unit: 'hourly', unit_amount: '20.65', quantity: '2.4', discount: '20.00%'}
}
],
time_entries: [
{
name: 'Colour Grading',
description: 'Opening scenes completed',
start: 1547501100,
end: 1547538900
}
]
}
],
project: [{id: 2342354, start: 1547501100, end: 1547538900}],
client: [{uuid: 'p4', contact_person: {id: 2837}}],
status: [
{
name: 'Second Hold',
description: 'Has second priority if the first hold cancels',
notification: true
}
],
billable_items: [
{
name: 'NAS Storage',
id: 2342354,
description: 'Rented per TB, per month',
cost: '25.23',
buy_cost: '20',
currency: 'AUD',
quantity: '4',
billable_item_id: 897832,
taxes: [{id: 3247, name: 'GST', rate: '10.00', total: '151.00'}],
create_new: true
}
],
custom_fields: [
{
id: 7823,
name: 'Type',
value: 'Video Editing',
value_id: 8973,
update_key: '2_1_7823'
}
]
})
};
fetch('https://api.sonderplan.com/v2/booking', 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.sonderplan.com/v2/booking",
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([
'id' => 1,
'name' => 'Test Booking',
'start' => 1547501100,
'end' => 1547538900,
'start_date_time_iso' => '2022-02-22T09:00:00+11:00',
'end_date_time_iso' => '2022-02-22T17:00:00+11:00',
'all_day' => 'false',
'notes' => 'Additional note',
'repeat_master' => 'true',
'repeat_master_id' => '0',
'repeat_rule' => 'FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;',
'resources' => [
[
'id' => 9458,
'rates' => [
[
'rate_scheme_id' => 984312,
'rate_scheme_name' => 'Resource Rate',
'currency' => 'AUD',
'buy' => [
'unit' => 'hourly',
'unit_amount' => '20.65',
'quantity' => '2.4',
'discount' => '20.00%'
],
'sell' => [
'unit' => 'hourly',
'unit_amount' => '20.65',
'quantity' => '2.4',
'discount' => '20.00%'
]
]
],
'time_entries' => [
[
'name' => 'Colour Grading',
'description' => 'Opening scenes completed',
'start' => 1547501100,
'end' => 1547538900
]
]
]
],
'project' => [
[
'id' => 2342354,
'start' => 1547501100,
'end' => 1547538900
]
],
'client' => [
[
'uuid' => 'p4',
'contact_person' => [
'id' => 2837
]
]
],
'status' => [
[
'name' => 'Second Hold',
'description' => 'Has second priority if the first hold cancels',
'notification' => true
]
],
'billable_items' => [
[
'name' => 'NAS Storage',
'id' => 2342354,
'description' => 'Rented per TB, per month',
'cost' => '25.23',
'buy_cost' => '20',
'currency' => 'AUD',
'quantity' => '4',
'billable_item_id' => 897832,
'taxes' => [
[
'id' => 3247,
'name' => 'GST',
'rate' => '10.00',
'total' => '151.00'
]
],
'create_new' => true
]
],
'custom_fields' => [
[
'id' => 7823,
'name' => 'Type',
'value' => 'Video Editing',
'value_id' => 8973,
'update_key' => '2_1_7823'
]
]
]),
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.sonderplan.com/v2/booking"
payload := strings.NewReader("{\n \"id\": 1,\n \"name\": \"Test Booking\",\n \"start\": 1547501100,\n \"end\": 1547538900,\n \"start_date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"end_date_time_iso\": \"2022-02-22T17:00:00+11:00\",\n \"all_day\": \"false\",\n \"notes\": \"Additional note\",\n \"repeat_master\": \"true\",\n \"repeat_master_id\": \"0\",\n \"repeat_rule\": \"FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;\",\n \"resources\": [\n {\n \"id\": 9458,\n \"rates\": [\n {\n \"rate_scheme_id\": 984312,\n \"rate_scheme_name\": \"Resource Rate\",\n \"currency\": \"AUD\",\n \"buy\": {\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"quantity\": \"2.4\",\n \"discount\": \"20.00%\"\n },\n \"sell\": {\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"quantity\": \"2.4\",\n \"discount\": \"20.00%\"\n }\n }\n ],\n \"time_entries\": [\n {\n \"name\": \"Colour Grading\",\n \"description\": \"Opening scenes completed\",\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ]\n }\n ],\n \"project\": [\n {\n \"id\": 2342354,\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ],\n \"client\": [\n {\n \"uuid\": \"p4\",\n \"contact_person\": {\n \"id\": 2837\n }\n }\n ],\n \"status\": [\n {\n \"name\": \"Second Hold\",\n \"description\": \"Has second priority if the first hold cancels\",\n \"notification\": true\n }\n ],\n \"billable_items\": [\n {\n \"name\": \"NAS Storage\",\n \"id\": 2342354,\n \"description\": \"Rented per TB, per month\",\n \"cost\": \"25.23\",\n \"buy_cost\": \"20\",\n \"currency\": \"AUD\",\n \"quantity\": \"4\",\n \"billable_item_id\": 897832,\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\n }\n ],\n \"create_new\": true\n }\n ],\n \"custom_fields\": [\n {\n \"id\": 7823,\n \"name\": \"Type\",\n \"value\": \"Video Editing\",\n \"value_id\": 8973,\n \"update_key\": \"2_1_7823\"\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://api.sonderplan.com/v2/booking")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"name\": \"Test Booking\",\n \"start\": 1547501100,\n \"end\": 1547538900,\n \"start_date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"end_date_time_iso\": \"2022-02-22T17:00:00+11:00\",\n \"all_day\": \"false\",\n \"notes\": \"Additional note\",\n \"repeat_master\": \"true\",\n \"repeat_master_id\": \"0\",\n \"repeat_rule\": \"FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;\",\n \"resources\": [\n {\n \"id\": 9458,\n \"rates\": [\n {\n \"rate_scheme_id\": 984312,\n \"rate_scheme_name\": \"Resource Rate\",\n \"currency\": \"AUD\",\n \"buy\": {\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"quantity\": \"2.4\",\n \"discount\": \"20.00%\"\n },\n \"sell\": {\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"quantity\": \"2.4\",\n \"discount\": \"20.00%\"\n }\n }\n ],\n \"time_entries\": [\n {\n \"name\": \"Colour Grading\",\n \"description\": \"Opening scenes completed\",\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ]\n }\n ],\n \"project\": [\n {\n \"id\": 2342354,\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ],\n \"client\": [\n {\n \"uuid\": \"p4\",\n \"contact_person\": {\n \"id\": 2837\n }\n }\n ],\n \"status\": [\n {\n \"name\": \"Second Hold\",\n \"description\": \"Has second priority if the first hold cancels\",\n \"notification\": true\n }\n ],\n \"billable_items\": [\n {\n \"name\": \"NAS Storage\",\n \"id\": 2342354,\n \"description\": \"Rented per TB, per month\",\n \"cost\": \"25.23\",\n \"buy_cost\": \"20\",\n \"currency\": \"AUD\",\n \"quantity\": \"4\",\n \"billable_item_id\": 897832,\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\n }\n ],\n \"create_new\": true\n }\n ],\n \"custom_fields\": [\n {\n \"id\": 7823,\n \"name\": \"Type\",\n \"value\": \"Video Editing\",\n \"value_id\": 8973,\n \"update_key\": \"2_1_7823\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sonderplan.com/v2/booking")
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 \"id\": 1,\n \"name\": \"Test Booking\",\n \"start\": 1547501100,\n \"end\": 1547538900,\n \"start_date_time_iso\": \"2022-02-22T09:00:00+11:00\",\n \"end_date_time_iso\": \"2022-02-22T17:00:00+11:00\",\n \"all_day\": \"false\",\n \"notes\": \"Additional note\",\n \"repeat_master\": \"true\",\n \"repeat_master_id\": \"0\",\n \"repeat_rule\": \"FREQ=daily;INTERVAL=2;REPENDTYPE=date;UNTIL=20220228T130000;\",\n \"resources\": [\n {\n \"id\": 9458,\n \"rates\": [\n {\n \"rate_scheme_id\": 984312,\n \"rate_scheme_name\": \"Resource Rate\",\n \"currency\": \"AUD\",\n \"buy\": {\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"quantity\": \"2.4\",\n \"discount\": \"20.00%\"\n },\n \"sell\": {\n \"unit\": \"hourly\",\n \"unit_amount\": \"20.65\",\n \"quantity\": \"2.4\",\n \"discount\": \"20.00%\"\n }\n }\n ],\n \"time_entries\": [\n {\n \"name\": \"Colour Grading\",\n \"description\": \"Opening scenes completed\",\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ]\n }\n ],\n \"project\": [\n {\n \"id\": 2342354,\n \"start\": 1547501100,\n \"end\": 1547538900\n }\n ],\n \"client\": [\n {\n \"uuid\": \"p4\",\n \"contact_person\": {\n \"id\": 2837\n }\n }\n ],\n \"status\": [\n {\n \"name\": \"Second Hold\",\n \"description\": \"Has second priority if the first hold cancels\",\n \"notification\": true\n }\n ],\n \"billable_items\": [\n {\n \"name\": \"NAS Storage\",\n \"id\": 2342354,\n \"description\": \"Rented per TB, per month\",\n \"cost\": \"25.23\",\n \"buy_cost\": \"20\",\n \"currency\": \"AUD\",\n \"quantity\": \"4\",\n \"billable_item_id\": 897832,\n \"taxes\": [\n {\n \"id\": 3247,\n \"name\": \"GST\",\n \"rate\": \"10.00\",\n \"total\": \"151.00\"\n }\n ],\n \"create_new\": true\n }\n ],\n \"custom_fields\": [\n {\n \"id\": 7823,\n \"name\": \"Type\",\n \"value\": \"Video Editing\",\n \"value_id\": 8973,\n \"update_key\": \"2_1_7823\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": {
"id": 1
}
}{
"error": {
"code": "404",
"message": "Requested resource was not found"
}
}Authorizations
Query Parameters
Body
application/json
Booking object that needs to be updated
Standard booking model that returns most properties by default