Update contact
curl --request PATCH \
--url https://api.debbiecollect.com/v1/{tenantId}/contacts/{contactId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": {
"locale": "45",
"number": "87654321"
}
}
'import requests
url = "https://api.debbiecollect.com/v1/{tenantId}/contacts/{contactId}"
payload = { "phone": {
"locale": "45",
"number": "87654321"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({phone: {locale: '45', number: '87654321'}})
};
fetch('https://api.debbiecollect.com/v1/{tenantId}/contacts/{contactId}', 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}/contacts/{contactId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'phone' => [
'locale' => '45',
'number' => '87654321'
]
]),
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}/contacts/{contactId}"
payload := strings.NewReader("{\n \"phone\": {\n \"locale\": \"45\",\n \"number\": \"87654321\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.debbiecollect.com/v1/{tenantId}/contacts/{contactId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": {\n \"locale\": \"45\",\n \"number\": \"87654321\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.debbiecollect.com/v1/{tenantId}/contacts/{contactId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": {\n \"locale\": \"45\",\n \"number\": \"87654321\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "jsmith@example.com",
"phone": {
"locale": "45",
"number": "12345678"
},
"registryIdentifier": {
"scheme": "DK:CVR",
"value": "12345678"
},
"bankAccount": {
"type": "DANISH",
"registrationNumber": "<string>",
"accountNumber": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": {},
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": {}
}Contacts
Update contact
Update a contact. Fields left out are unchanged; email, phone, registryIdentifier and bankAccount are cleared by sending null. Only administrators can update contacts.
Required scope: write:contacts
PATCH
/
v1
/
{tenantId}
/
contacts
/
{contactId}
Update contact
curl --request PATCH \
--url https://api.debbiecollect.com/v1/{tenantId}/contacts/{contactId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": {
"locale": "45",
"number": "87654321"
}
}
'import requests
url = "https://api.debbiecollect.com/v1/{tenantId}/contacts/{contactId}"
payload = { "phone": {
"locale": "45",
"number": "87654321"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({phone: {locale: '45', number: '87654321'}})
};
fetch('https://api.debbiecollect.com/v1/{tenantId}/contacts/{contactId}', 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}/contacts/{contactId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'phone' => [
'locale' => '45',
'number' => '87654321'
]
]),
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}/contacts/{contactId}"
payload := strings.NewReader("{\n \"phone\": {\n \"locale\": \"45\",\n \"number\": \"87654321\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.debbiecollect.com/v1/{tenantId}/contacts/{contactId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": {\n \"locale\": \"45\",\n \"number\": \"87654321\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.debbiecollect.com/v1/{tenantId}/contacts/{contactId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": {\n \"locale\": \"45\",\n \"number\": \"87654321\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "jsmith@example.com",
"phone": {
"locale": "45",
"number": "12345678"
},
"registryIdentifier": {
"scheme": "DK:CVR",
"value": "12345678"
},
"bankAccount": {
"type": "DANISH",
"registrationNumber": "<string>",
"accountNumber": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": {},
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": {}
}Authorizations
Path Parameters
Body
application/json
Response
Successful operation