Add user on customer
curl --request POST \
--url https://api.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lang": "da",
"contact": true,
"relation": "alternative-contact",
"details": {
"name": "Hans Hansen",
"email": "example@debbie.dk",
"description": "Driver of the vehicle",
"phone": {
"locale": "45",
"number": "12345678"
},
"address": {
"address": "Applebys Plads 7, 1.",
"city": "København K",
"zipcode": "1411"
}
}
}
'import requests
url = "https://api.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users"
payload = {
"lang": "da",
"contact": True,
"relation": "alternative-contact",
"details": {
"name": "Hans Hansen",
"email": "example@debbie.dk",
"description": "Driver of the vehicle",
"phone": {
"locale": "45",
"number": "12345678"
},
"address": {
"address": "Applebys Plads 7, 1.",
"city": "København K",
"zipcode": "1411"
}
}
}
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({
lang: 'da',
contact: true,
relation: 'alternative-contact',
details: {
name: 'Hans Hansen',
email: 'example@debbie.dk',
description: 'Driver of the vehicle',
phone: {locale: '45', number: '12345678'},
address: {address: 'Applebys Plads 7, 1.', city: 'København K', zipcode: '1411'}
}
})
};
fetch('https://api.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users', 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.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users",
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([
'lang' => 'da',
'contact' => true,
'relation' => 'alternative-contact',
'details' => [
'name' => 'Hans Hansen',
'email' => 'example@debbie.dk',
'description' => 'Driver of the vehicle',
'phone' => [
'locale' => '45',
'number' => '12345678'
],
'address' => [
'address' => 'Applebys Plads 7, 1.',
'city' => 'København K',
'zipcode' => '1411'
]
]
]),
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.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users"
payload := strings.NewReader("{\n \"lang\": \"da\",\n \"contact\": true,\n \"relation\": \"alternative-contact\",\n \"details\": {\n \"name\": \"Hans Hansen\",\n \"email\": \"example@debbie.dk\",\n \"description\": \"Driver of the vehicle\",\n \"phone\": {\n \"locale\": \"45\",\n \"number\": \"12345678\"\n },\n \"address\": {\n \"address\": \"Applebys Plads 7, 1.\",\n \"city\": \"København K\",\n \"zipcode\": \"1411\"\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.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"lang\": \"da\",\n \"contact\": true,\n \"relation\": \"alternative-contact\",\n \"details\": {\n \"name\": \"Hans Hansen\",\n \"email\": \"example@debbie.dk\",\n \"description\": \"Driver of the vehicle\",\n \"phone\": {\n \"locale\": \"45\",\n \"number\": \"12345678\"\n },\n \"address\": {\n \"address\": \"Applebys Plads 7, 1.\",\n \"city\": \"København K\",\n \"zipcode\": \"1411\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users")
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 \"lang\": \"da\",\n \"contact\": true,\n \"relation\": \"alternative-contact\",\n \"details\": {\n \"name\": \"Hans Hansen\",\n \"email\": \"example@debbie.dk\",\n \"description\": \"Driver of the vehicle\",\n \"phone\": {\n \"locale\": \"45\",\n \"number\": \"12345678\"\n },\n \"address\": {\n \"address\": \"Applebys Plads 7, 1.\",\n \"city\": \"København K\",\n \"zipcode\": \"1411\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"userOnCustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": 123,
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Customers
Add user on customer
Add a new user (party) to a customer. Use this to add for example a driver, a representative or another party that should be able to receive communication on the customer’s cases.
Required scope: write:customers
POST
/
v1
/
{tenantId}
/
customers
/
{customerId}
/
users
Add user on customer
curl --request POST \
--url https://api.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lang": "da",
"contact": true,
"relation": "alternative-contact",
"details": {
"name": "Hans Hansen",
"email": "example@debbie.dk",
"description": "Driver of the vehicle",
"phone": {
"locale": "45",
"number": "12345678"
},
"address": {
"address": "Applebys Plads 7, 1.",
"city": "København K",
"zipcode": "1411"
}
}
}
'import requests
url = "https://api.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users"
payload = {
"lang": "da",
"contact": True,
"relation": "alternative-contact",
"details": {
"name": "Hans Hansen",
"email": "example@debbie.dk",
"description": "Driver of the vehicle",
"phone": {
"locale": "45",
"number": "12345678"
},
"address": {
"address": "Applebys Plads 7, 1.",
"city": "København K",
"zipcode": "1411"
}
}
}
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({
lang: 'da',
contact: true,
relation: 'alternative-contact',
details: {
name: 'Hans Hansen',
email: 'example@debbie.dk',
description: 'Driver of the vehicle',
phone: {locale: '45', number: '12345678'},
address: {address: 'Applebys Plads 7, 1.', city: 'København K', zipcode: '1411'}
}
})
};
fetch('https://api.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users', 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.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users",
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([
'lang' => 'da',
'contact' => true,
'relation' => 'alternative-contact',
'details' => [
'name' => 'Hans Hansen',
'email' => 'example@debbie.dk',
'description' => 'Driver of the vehicle',
'phone' => [
'locale' => '45',
'number' => '12345678'
],
'address' => [
'address' => 'Applebys Plads 7, 1.',
'city' => 'København K',
'zipcode' => '1411'
]
]
]),
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.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users"
payload := strings.NewReader("{\n \"lang\": \"da\",\n \"contact\": true,\n \"relation\": \"alternative-contact\",\n \"details\": {\n \"name\": \"Hans Hansen\",\n \"email\": \"example@debbie.dk\",\n \"description\": \"Driver of the vehicle\",\n \"phone\": {\n \"locale\": \"45\",\n \"number\": \"12345678\"\n },\n \"address\": {\n \"address\": \"Applebys Plads 7, 1.\",\n \"city\": \"København K\",\n \"zipcode\": \"1411\"\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.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"lang\": \"da\",\n \"contact\": true,\n \"relation\": \"alternative-contact\",\n \"details\": {\n \"name\": \"Hans Hansen\",\n \"email\": \"example@debbie.dk\",\n \"description\": \"Driver of the vehicle\",\n \"phone\": {\n \"locale\": \"45\",\n \"number\": \"12345678\"\n },\n \"address\": {\n \"address\": \"Applebys Plads 7, 1.\",\n \"city\": \"København K\",\n \"zipcode\": \"1411\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.debbiecollect.com/v1/{tenantId}/customers/{customerId}/users")
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 \"lang\": \"da\",\n \"contact\": true,\n \"relation\": \"alternative-contact\",\n \"details\": {\n \"name\": \"Hans Hansen\",\n \"email\": \"example@debbie.dk\",\n \"description\": \"Driver of the vehicle\",\n \"phone\": {\n \"locale\": \"45\",\n \"number\": \"12345678\"\n },\n \"address\": {\n \"address\": \"Applebys Plads 7, 1.\",\n \"city\": \"København K\",\n \"zipcode\": \"1411\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"userOnCustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": 123,
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Authorizations
Authentication can be done by using a bearer token in the Authorization header. This is done using the following format Authorization: Bearer {token}.
Path Parameters
Id of the tenant the customer belongs to
Id of the customer
Body
application/json
New user on customer body
The language of the user
Available options:
bm, ba, eu, be, bn, bh, bi, bs, br, bg, my, ca, ch, ce, ny, zh, cv, kw, co, cr, hr, cs, da, dv, nl, dz, en, eo, et, ee, fo, fj, fi, fr, ff, gl, ka, de, el, gn, gu, ht, ha, he, hz, hi, ho, hu, ia, id, ie, ga, ig, ik, io, is, it, iu, ja, jv, kl, kn, kr, ks, kk, km, ki, rw, ky, kv, kg, ko, ku, kj, la, lb, lg, li, ln, lo, lt, lu, lv, gv, mk, mg, ms, ml, mt, mi, mr, mh, mn, na, nv, nd, ne, ng, nb, nn, no, ii, nr, oc, oj, cu, om, or, os, pa, pi, fa, pl, ps, pt, qu, rm, rn, ro, ru, sa, sc, sd, se, sm, sg, sr, gd, sn, si, sk, sl, so, st, es, su, sw, ss, sv, ta, te, tg, th, ti, bo, tk, tl, tn, to, tr, ts, tt, tw, ty, ug, uk, ur, uz, ve, vi, vo, wa, cy, wo, fy, xh, yi, yo, za, zu Whether the user should be the contact person of the customer
The relation of the user to the customer. Use alternative-contact for a party that is not the debtor itself, for example a driver or a representative.
Available options:
debtor, alternative-contact Show child attributes
Show child attributes