Skip to main content
POST
/
v2
/
booking
/
bulk
Bulk Bookings
curl --request POST \
  --url https://api.sonderplan.com/v2/booking/bulk \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "save": {
    "common_properties": [
      {
        "calendar_subscription_id": 234982,
        "resources": [
          {
            "id": 34982
          }
        ],
        "project": [
          {
            "id": 239909
          }
        ],
        "status": [
          {
            "id": 40123
          }
        ],
        "client": [
          {
            "uuid": "p209809"
          }
        ]
      }
    ],
    "columns": [
      "external_id",
      "start",
      "end",
      "name",
      "notes"
    ],
    "values": [
      "<unknown>"
    ]
  },
  "delete": {
    "id": [
      98923,
      19812,
      23838
    ],
    "external_id": [
      "1234j@kf9i094-090-9435aasdas"
    ],
    "calendar_subscription_id": [
      989232349
    ]
  }
}
'
import requests

url = "https://api.sonderplan.com/v2/booking/bulk"

payload = {
"save": {
"common_properties": [
{
"calendar_subscription_id": 234982,
"resources": [{ "id": 34982 }],
"project": [{ "id": 239909 }],
"status": [{ "id": 40123 }],
"client": [{ "uuid": "p209809" }]
}
],
"columns": ["external_id", "start", "end", "name", "notes"],
"values": ["<unknown>"]
},
"delete": {
"id": [98923, 19812, 23838],
"external_id": ["1234j@kf9i094-090-9435aasdas"],
"calendar_subscription_id": [989232349]
}
}
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({
save: {
common_properties: [
{
calendar_subscription_id: 234982,
resources: [{id: 34982}],
project: [{id: 239909}],
status: [{id: 40123}],
client: [{uuid: 'p209809'}]
}
],
columns: ['external_id', 'start', 'end', 'name', 'notes'],
values: ['<unknown>']
},
delete: {
id: [98923, 19812, 23838],
external_id: ['1234j@kf9i094-090-9435aasdas'],
calendar_subscription_id: [989232349]
}
})
};

fetch('https://api.sonderplan.com/v2/booking/bulk', 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/bulk",
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([
'save' => [
'common_properties' => [
[
'calendar_subscription_id' => 234982,
'resources' => [
[
'id' => 34982
]
],
'project' => [
[
'id' => 239909
]
],
'status' => [
[
'id' => 40123
]
],
'client' => [
[
'uuid' => 'p209809'
]
]
]
],
'columns' => [
'external_id',
'start',
'end',
'name',
'notes'
],
'values' => [
'<unknown>'
]
],
'delete' => [
'id' => [
98923,
19812,
23838
],
'external_id' => [
'1234j@kf9i094-090-9435aasdas'
],
'calendar_subscription_id' => [
989232349
]
]
]),
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/bulk"

payload := strings.NewReader("{\n \"save\": {\n \"common_properties\": [\n {\n \"calendar_subscription_id\": 234982,\n \"resources\": [\n {\n \"id\": 34982\n }\n ],\n \"project\": [\n {\n \"id\": 239909\n }\n ],\n \"status\": [\n {\n \"id\": 40123\n }\n ],\n \"client\": [\n {\n \"uuid\": \"p209809\"\n }\n ]\n }\n ],\n \"columns\": [\n \"external_id\",\n \"start\",\n \"end\",\n \"name\",\n \"notes\"\n ],\n \"values\": [\n \"<unknown>\"\n ]\n },\n \"delete\": {\n \"id\": [\n 98923,\n 19812,\n 23838\n ],\n \"external_id\": [\n \"1234j@kf9i094-090-9435aasdas\"\n ],\n \"calendar_subscription_id\": [\n 989232349\n ]\n }\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://api.sonderplan.com/v2/booking/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"save\": {\n \"common_properties\": [\n {\n \"calendar_subscription_id\": 234982,\n \"resources\": [\n {\n \"id\": 34982\n }\n ],\n \"project\": [\n {\n \"id\": 239909\n }\n ],\n \"status\": [\n {\n \"id\": 40123\n }\n ],\n \"client\": [\n {\n \"uuid\": \"p209809\"\n }\n ]\n }\n ],\n \"columns\": [\n \"external_id\",\n \"start\",\n \"end\",\n \"name\",\n \"notes\"\n ],\n \"values\": [\n \"<unknown>\"\n ]\n },\n \"delete\": {\n \"id\": [\n 98923,\n 19812,\n 23838\n ],\n \"external_id\": [\n \"1234j@kf9i094-090-9435aasdas\"\n ],\n \"calendar_subscription_id\": [\n 989232349\n ]\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sonderplan.com/v2/booking/bulk")

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 \"save\": {\n \"common_properties\": [\n {\n \"calendar_subscription_id\": 234982,\n \"resources\": [\n {\n \"id\": 34982\n }\n ],\n \"project\": [\n {\n \"id\": 239909\n }\n ],\n \"status\": [\n {\n \"id\": 40123\n }\n ],\n \"client\": [\n {\n \"uuid\": \"p209809\"\n }\n ]\n }\n ],\n \"columns\": [\n \"external_id\",\n \"start\",\n \"end\",\n \"name\",\n \"notes\"\n ],\n \"values\": [\n \"<unknown>\"\n ]\n },\n \"delete\": {\n \"id\": [\n 98923,\n 19812,\n 23838\n ],\n \"external_id\": [\n \"1234j@kf9i094-090-9435aasdas\"\n ],\n \"calendar_subscription_id\": [\n 989232349\n ]\n }\n}"

response = http.request(request)
puts response.read_body
{
  "save": {
    "success": [
      {
        "id": 2340,
        "external_id": "1234j@kf9i094-090-9435aasdas"
      }
    ]
  },
  "delete": {
    "id": {
      "success": true
    },
    "external_id": {
      "success": true
    },
    "calendar_subscription_id": {
      "success": true
    }
  }
}
{
"error": {
"code": 400,
"message": "name is required... Name of the tax"
}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Allows bulk creation, modification and deletion of bookings

save
object

Create new or update existing bookings (be sure to include an external_id column so we know which bookings to update

delete
object

Delete existing bookings by either id, external_id or calendar_subscription_id

Response

Successful Operation

save
object
delete
object