Update Contact (Deprecated)
This API allows you to update the information of an existing contact in the system. To do so, you need to provide the contact email and the updated details of the contact.
curl --request PUT \
--url https://api.cleverhub.co/api/v2/contact/update_info \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"email": "test@example.com",
"first_name": "Luyx",
"last_name": "Tran",
"type": "individual",
"dob": "1991-12-24",
"reg_no": "123456789",
"phone": "+6123224242",
"gender": "male",
"street": "338 George Street",
"city": "Sydney",
"postal_code": "2000",
"state": "New South Wales",
"country": "AU"
}
'import requests
url = "https://api.cleverhub.co/api/v2/contact/update_info"
payload = {
"email": "test@example.com",
"first_name": "Luyx",
"last_name": "Tran",
"type": "individual",
"dob": "1991-12-24",
"reg_no": "123456789",
"phone": "+6123224242",
"gender": "male",
"street": "338 George Street",
"city": "Sydney",
"postal_code": "2000",
"state": "New South Wales",
"country": "AU"
}
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'test@example.com',
first_name: 'Luyx',
last_name: 'Tran',
type: 'individual',
dob: '1991-12-24',
reg_no: '123456789',
phone: '+6123224242',
gender: 'male',
street: '338 George Street',
city: 'Sydney',
postal_code: '2000',
state: 'New South Wales',
country: 'AU'
})
};
fetch('https://api.cleverhub.co/api/v2/contact/update_info', 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.cleverhub.co/api/v2/contact/update_info",
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([
'email' => 'test@example.com',
'first_name' => 'Luyx',
'last_name' => 'Tran',
'type' => 'individual',
'dob' => '1991-12-24',
'reg_no' => '123456789',
'phone' => '+6123224242',
'gender' => 'male',
'street' => '338 George Street',
'city' => 'Sydney',
'postal_code' => '2000',
'state' => 'New South Wales',
'country' => 'AU'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-key: <api-key>"
],
]);
$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.cleverhub.co/api/v2/contact/update_info"
payload := strings.NewReader("{\n \"email\": \"test@example.com\",\n \"first_name\": \"Luyx\",\n \"last_name\": \"Tran\",\n \"type\": \"individual\",\n \"dob\": \"1991-12-24\",\n \"reg_no\": \"123456789\",\n \"phone\": \"+6123224242\",\n \"gender\": \"male\",\n \"street\": \"338 George Street\",\n \"city\": \"Sydney\",\n \"postal_code\": \"2000\",\n \"state\": \"New South Wales\",\n \"country\": \"AU\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<api-key>")
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://api.cleverhub.co/api/v2/contact/update_info")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"test@example.com\",\n \"first_name\": \"Luyx\",\n \"last_name\": \"Tran\",\n \"type\": \"individual\",\n \"dob\": \"1991-12-24\",\n \"reg_no\": \"123456789\",\n \"phone\": \"+6123224242\",\n \"gender\": \"male\",\n \"street\": \"338 George Street\",\n \"city\": \"Sydney\",\n \"postal_code\": \"2000\",\n \"state\": \"New South Wales\",\n \"country\": \"AU\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleverhub.co/api/v2/contact/update_info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"test@example.com\",\n \"first_name\": \"Luyx\",\n \"last_name\": \"Tran\",\n \"type\": \"individual\",\n \"dob\": \"1991-12-24\",\n \"reg_no\": \"123456789\",\n \"phone\": \"+6123224242\",\n \"gender\": \"male\",\n \"street\": \"338 George Street\",\n \"city\": \"Sydney\",\n \"postal_code\": \"2000\",\n \"state\": \"New South Wales\",\n \"country\": \"AU\"\n}"
response = http.request(request)
puts response.read_body{
"status": "Ok"
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"message": "Email can't be blank"
}
}Authorizations
A unique identifier assigned to each application.
A secure token associated with the app-id.
Body
The contact's email used for verification.
Contact's first name.
Contact's last name.
The type of the contact (e.g., individual or organization).
individual, organization "individual"
Contact's date of birth, format 'yyyy-mm-dd'.
Contact registration number, required if type is organization.
Contact's phone number.
"+1234567890"
Contact's gender
male, female The primary name of an address's street for the contact.
Name of an address's city or town for the contact.
The contact's address's postcode.
The contact's address's state / province / county.
ISO 3166-1 alpha-2 country code of the contact's country.
Response
Contact updated successfully
curl --request PUT \
--url https://api.cleverhub.co/api/v2/contact/update_info \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"email": "test@example.com",
"first_name": "Luyx",
"last_name": "Tran",
"type": "individual",
"dob": "1991-12-24",
"reg_no": "123456789",
"phone": "+6123224242",
"gender": "male",
"street": "338 George Street",
"city": "Sydney",
"postal_code": "2000",
"state": "New South Wales",
"country": "AU"
}
'import requests
url = "https://api.cleverhub.co/api/v2/contact/update_info"
payload = {
"email": "test@example.com",
"first_name": "Luyx",
"last_name": "Tran",
"type": "individual",
"dob": "1991-12-24",
"reg_no": "123456789",
"phone": "+6123224242",
"gender": "male",
"street": "338 George Street",
"city": "Sydney",
"postal_code": "2000",
"state": "New South Wales",
"country": "AU"
}
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'test@example.com',
first_name: 'Luyx',
last_name: 'Tran',
type: 'individual',
dob: '1991-12-24',
reg_no: '123456789',
phone: '+6123224242',
gender: 'male',
street: '338 George Street',
city: 'Sydney',
postal_code: '2000',
state: 'New South Wales',
country: 'AU'
})
};
fetch('https://api.cleverhub.co/api/v2/contact/update_info', 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.cleverhub.co/api/v2/contact/update_info",
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([
'email' => 'test@example.com',
'first_name' => 'Luyx',
'last_name' => 'Tran',
'type' => 'individual',
'dob' => '1991-12-24',
'reg_no' => '123456789',
'phone' => '+6123224242',
'gender' => 'male',
'street' => '338 George Street',
'city' => 'Sydney',
'postal_code' => '2000',
'state' => 'New South Wales',
'country' => 'AU'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-key: <api-key>"
],
]);
$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.cleverhub.co/api/v2/contact/update_info"
payload := strings.NewReader("{\n \"email\": \"test@example.com\",\n \"first_name\": \"Luyx\",\n \"last_name\": \"Tran\",\n \"type\": \"individual\",\n \"dob\": \"1991-12-24\",\n \"reg_no\": \"123456789\",\n \"phone\": \"+6123224242\",\n \"gender\": \"male\",\n \"street\": \"338 George Street\",\n \"city\": \"Sydney\",\n \"postal_code\": \"2000\",\n \"state\": \"New South Wales\",\n \"country\": \"AU\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<api-key>")
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://api.cleverhub.co/api/v2/contact/update_info")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"test@example.com\",\n \"first_name\": \"Luyx\",\n \"last_name\": \"Tran\",\n \"type\": \"individual\",\n \"dob\": \"1991-12-24\",\n \"reg_no\": \"123456789\",\n \"phone\": \"+6123224242\",\n \"gender\": \"male\",\n \"street\": \"338 George Street\",\n \"city\": \"Sydney\",\n \"postal_code\": \"2000\",\n \"state\": \"New South Wales\",\n \"country\": \"AU\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleverhub.co/api/v2/contact/update_info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"test@example.com\",\n \"first_name\": \"Luyx\",\n \"last_name\": \"Tran\",\n \"type\": \"individual\",\n \"dob\": \"1991-12-24\",\n \"reg_no\": \"123456789\",\n \"phone\": \"+6123224242\",\n \"gender\": \"male\",\n \"street\": \"338 George Street\",\n \"city\": \"Sydney\",\n \"postal_code\": \"2000\",\n \"state\": \"New South Wales\",\n \"country\": \"AU\"\n}"
response = http.request(request)
puts response.read_body{
"status": "Ok"
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"message": "Email can't be blank"
}
}