curl --request PUT \
--url 'https://sandbox.circularo.com/api/v1/contacts?token=' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"mail": "james.baines@example.com",
"company": "Acme Corporation",
"fullname": "James Baines",
"language": "en",
"location": "Prague",
"phone": "+38591234567",
"photo": {
"big": "s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj",
"medium": "<string>",
"nano": "<string>",
"small": "<string>"
},
"timezone": "Europe/Zagreb"
},
"ids": [
"dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b"
]
}
'import requests
url = "https://sandbox.circularo.com/api/v1/contacts?token="
payload = {
"data": {
"mail": "james.baines@example.com",
"company": "Acme Corporation",
"fullname": "James Baines",
"language": "en",
"location": "Prague",
"phone": "+38591234567",
"photo": {
"big": "s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj",
"medium": "<string>",
"nano": "<string>",
"small": "<string>"
},
"timezone": "Europe/Zagreb"
},
"ids": ["dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b"]
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
mail: 'james.baines@example.com',
company: 'Acme Corporation',
fullname: 'James Baines',
language: 'en',
location: 'Prague',
phone: '+38591234567',
photo: {
big: 's1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj',
medium: '<string>',
nano: '<string>',
small: '<string>'
},
timezone: 'Europe/Zagreb'
},
ids: ['dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b']
})
};
fetch('https://sandbox.circularo.com/api/v1/contacts?token=', 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://sandbox.circularo.com/api/v1/contacts?token=",
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([
'data' => [
'mail' => 'james.baines@example.com',
'company' => 'Acme Corporation',
'fullname' => 'James Baines',
'language' => 'en',
'location' => 'Prague',
'phone' => '+38591234567',
'photo' => [
'big' => 's1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj',
'medium' => '<string>',
'nano' => '<string>',
'small' => '<string>'
],
'timezone' => 'Europe/Zagreb'
],
'ids' => [
'dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b'
]
]),
CURLOPT_HTTPHEADER => [
"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://sandbox.circularo.com/api/v1/contacts?token="
payload := strings.NewReader("{\n \"data\": {\n \"mail\": \"james.baines@example.com\",\n \"company\": \"Acme Corporation\",\n \"fullname\": \"James Baines\",\n \"language\": \"en\",\n \"location\": \"Prague\",\n \"phone\": \"+38591234567\",\n \"photo\": {\n \"big\": \"s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj\",\n \"medium\": \"<string>\",\n \"nano\": \"<string>\",\n \"small\": \"<string>\"\n },\n \"timezone\": \"Europe/Zagreb\"\n },\n \"ids\": [\n \"dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
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://sandbox.circularo.com/api/v1/contacts?token=")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"mail\": \"james.baines@example.com\",\n \"company\": \"Acme Corporation\",\n \"fullname\": \"James Baines\",\n \"language\": \"en\",\n \"location\": \"Prague\",\n \"phone\": \"+38591234567\",\n \"photo\": {\n \"big\": \"s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj\",\n \"medium\": \"<string>\",\n \"nano\": \"<string>\",\n \"small\": \"<string>\"\n },\n \"timezone\": \"Europe/Zagreb\"\n },\n \"ids\": [\n \"dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/contacts?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"mail\": \"james.baines@example.com\",\n \"company\": \"Acme Corporation\",\n \"fullname\": \"James Baines\",\n \"language\": \"en\",\n \"location\": \"Prague\",\n \"phone\": \"+38591234567\",\n \"photo\": {\n \"big\": \"s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj\",\n \"medium\": \"<string>\",\n \"nano\": \"<string>\",\n \"small\": \"<string>\"\n },\n \"timezone\": \"Europe/Zagreb\"\n },\n \"ids\": [\n \"dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"count": 22,
"errors": false,
"items": [
{
"id": "a0d01c9d-f72f-4c57-af11-e26bda19cc59",
"index": "default_documents",
"status": 409,
"message": "Incorrect version",
"payload": {},
"type": "DOCUMENT:VERSION_CONFLICT"
}
]
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Update contacts
PUT /contacts
Writes the same set of properties onto one or more contacts and reports the outcome per contact. Editing is open to the owner, whoever added the contact, and anyone it was shared with for editing; a contact the caller may not edit is reported as a failed item rather than failing the whole call.
Because a contact is identified by its e-mail address, changing mail does not edit the record in place - the contact is rewritten under a new identifier and the old one is removed, so a client holding the old identifier has to pick up the new one from the result.
Token authorization: Authorize using a token — either a session token obtained from login or an API key — to call this endpoint.
curl --request PUT \
--url 'https://sandbox.circularo.com/api/v1/contacts?token=' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"mail": "james.baines@example.com",
"company": "Acme Corporation",
"fullname": "James Baines",
"language": "en",
"location": "Prague",
"phone": "+38591234567",
"photo": {
"big": "s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj",
"medium": "<string>",
"nano": "<string>",
"small": "<string>"
},
"timezone": "Europe/Zagreb"
},
"ids": [
"dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b"
]
}
'import requests
url = "https://sandbox.circularo.com/api/v1/contacts?token="
payload = {
"data": {
"mail": "james.baines@example.com",
"company": "Acme Corporation",
"fullname": "James Baines",
"language": "en",
"location": "Prague",
"phone": "+38591234567",
"photo": {
"big": "s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj",
"medium": "<string>",
"nano": "<string>",
"small": "<string>"
},
"timezone": "Europe/Zagreb"
},
"ids": ["dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b"]
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
mail: 'james.baines@example.com',
company: 'Acme Corporation',
fullname: 'James Baines',
language: 'en',
location: 'Prague',
phone: '+38591234567',
photo: {
big: 's1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj',
medium: '<string>',
nano: '<string>',
small: '<string>'
},
timezone: 'Europe/Zagreb'
},
ids: ['dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b']
})
};
fetch('https://sandbox.circularo.com/api/v1/contacts?token=', 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://sandbox.circularo.com/api/v1/contacts?token=",
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([
'data' => [
'mail' => 'james.baines@example.com',
'company' => 'Acme Corporation',
'fullname' => 'James Baines',
'language' => 'en',
'location' => 'Prague',
'phone' => '+38591234567',
'photo' => [
'big' => 's1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj',
'medium' => '<string>',
'nano' => '<string>',
'small' => '<string>'
],
'timezone' => 'Europe/Zagreb'
],
'ids' => [
'dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b'
]
]),
CURLOPT_HTTPHEADER => [
"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://sandbox.circularo.com/api/v1/contacts?token="
payload := strings.NewReader("{\n \"data\": {\n \"mail\": \"james.baines@example.com\",\n \"company\": \"Acme Corporation\",\n \"fullname\": \"James Baines\",\n \"language\": \"en\",\n \"location\": \"Prague\",\n \"phone\": \"+38591234567\",\n \"photo\": {\n \"big\": \"s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj\",\n \"medium\": \"<string>\",\n \"nano\": \"<string>\",\n \"small\": \"<string>\"\n },\n \"timezone\": \"Europe/Zagreb\"\n },\n \"ids\": [\n \"dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
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://sandbox.circularo.com/api/v1/contacts?token=")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"mail\": \"james.baines@example.com\",\n \"company\": \"Acme Corporation\",\n \"fullname\": \"James Baines\",\n \"language\": \"en\",\n \"location\": \"Prague\",\n \"phone\": \"+38591234567\",\n \"photo\": {\n \"big\": \"s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj\",\n \"medium\": \"<string>\",\n \"nano\": \"<string>\",\n \"small\": \"<string>\"\n },\n \"timezone\": \"Europe/Zagreb\"\n },\n \"ids\": [\n \"dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/contacts?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"mail\": \"james.baines@example.com\",\n \"company\": \"Acme Corporation\",\n \"fullname\": \"James Baines\",\n \"language\": \"en\",\n \"location\": \"Prague\",\n \"phone\": \"+38591234567\",\n \"photo\": {\n \"big\": \"s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj\",\n \"medium\": \"<string>\",\n \"nano\": \"<string>\",\n \"small\": \"<string>\"\n },\n \"timezone\": \"Europe/Zagreb\"\n },\n \"ids\": [\n \"dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"count": 22,
"errors": false,
"items": [
{
"id": "a0d01c9d-f72f-4c57-af11-e26bda19cc59",
"index": "default_documents",
"status": 409,
"message": "Incorrect version",
"payload": {},
"type": "DOCUMENT:VERSION_CONFLICT"
}
]
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Authorizations
Body
Identifiers of the contacts to update. A photo given as the hash of an already uploaded file can only be sent when this list holds exactly one contact; a photo sent inline as base64 has no such limit.
1 - 1000 elements1[
"dff8fe9414afa6668d5107265e87d5d63019ab315b55e27061d53505b"
]
Response
Reports the outcome for each contact; individual contacts may still have failed - one whose photo sent as base64 starts as a PDF but cannot be read as one, for example - so read the per-item results.