Nieuwe klant aanmaken
curl --request POST \
--url https://api.clientbox.co/api/1.1/wf/create-customer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "Sophie",
"last_name": "de Vries",
"email": "sophie@start-up.nl",
"company_name": "Tech B.V."
}
'import requests
url = "https://api.clientbox.co/api/1.1/wf/create-customer"
payload = {
"first_name": "Sophie",
"last_name": "de Vries",
"email": "sophie@start-up.nl",
"company_name": "Tech B.V."
}
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({
first_name: 'Sophie',
last_name: 'de Vries',
email: 'sophie@start-up.nl',
company_name: 'Tech B.V.'
})
};
fetch('https://api.clientbox.co/api/1.1/wf/create-customer', 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.clientbox.co/api/1.1/wf/create-customer",
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([
'first_name' => 'Sophie',
'last_name' => 'de Vries',
'email' => 'sophie@start-up.nl',
'company_name' => 'Tech B.V.'
]),
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.clientbox.co/api/1.1/wf/create-customer"
payload := strings.NewReader("{\n \"first_name\": \"Sophie\",\n \"last_name\": \"de Vries\",\n \"email\": \"sophie@start-up.nl\",\n \"company_name\": \"Tech B.V.\"\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.clientbox.co/api/1.1/wf/create-customer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"Sophie\",\n \"last_name\": \"de Vries\",\n \"email\": \"sophie@start-up.nl\",\n \"company_name\": \"Tech B.V.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clientbox.co/api/1.1/wf/create-customer")
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 \"first_name\": \"Sophie\",\n \"last_name\": \"de Vries\",\n \"email\": \"sophie@start-up.nl\",\n \"company_name\": \"Tech B.V.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "cust_12345",
"name": "Jan Jansen",
"email": "jan@bedrijf.nl"
}{
"status": "error",
"message": "Ongeldige input data."
}Customers
Nieuwe klant aanmaken
Voegt een nieuwe klant toe aan je ClientBox database.
Let op: Het e-mailadres moet uniek zijn. Als het al bestaat, krijg je een 409 Conflict error terug.
POST
/
create-customer
Nieuwe klant aanmaken
curl --request POST \
--url https://api.clientbox.co/api/1.1/wf/create-customer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "Sophie",
"last_name": "de Vries",
"email": "sophie@start-up.nl",
"company_name": "Tech B.V."
}
'import requests
url = "https://api.clientbox.co/api/1.1/wf/create-customer"
payload = {
"first_name": "Sophie",
"last_name": "de Vries",
"email": "sophie@start-up.nl",
"company_name": "Tech B.V."
}
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({
first_name: 'Sophie',
last_name: 'de Vries',
email: 'sophie@start-up.nl',
company_name: 'Tech B.V.'
})
};
fetch('https://api.clientbox.co/api/1.1/wf/create-customer', 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.clientbox.co/api/1.1/wf/create-customer",
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([
'first_name' => 'Sophie',
'last_name' => 'de Vries',
'email' => 'sophie@start-up.nl',
'company_name' => 'Tech B.V.'
]),
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.clientbox.co/api/1.1/wf/create-customer"
payload := strings.NewReader("{\n \"first_name\": \"Sophie\",\n \"last_name\": \"de Vries\",\n \"email\": \"sophie@start-up.nl\",\n \"company_name\": \"Tech B.V.\"\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.clientbox.co/api/1.1/wf/create-customer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"Sophie\",\n \"last_name\": \"de Vries\",\n \"email\": \"sophie@start-up.nl\",\n \"company_name\": \"Tech B.V.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clientbox.co/api/1.1/wf/create-customer")
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 \"first_name\": \"Sophie\",\n \"last_name\": \"de Vries\",\n \"email\": \"sophie@start-up.nl\",\n \"company_name\": \"Tech B.V.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "cust_12345",
"name": "Jan Jansen",
"email": "jan@bedrijf.nl"
}{
"status": "error",
"message": "Ongeldige input data."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
De voornaam van de klant.
Example:
"Sophie"
De achternaam van de klant.
Example:
"de Vries"
Het zakelijke e-mailadres. Wordt gebruikt voor communicatie.
Example:
"sophie@start-up.nl"
Optioneel: Bedrijfsnaam.
Example:
"Tech B.V."
Was this page helpful?
⌘I

