Contact
Get Contact Requests in a Period of Time
This API allows you to fetch a complete list of contacts linked to your app-id. You can filter the results based on multiple query params. This API is paginated. The default is 20 records per page.
GET
/
v2
/
contacts
/
all
Get Contact Requests in a Period of Time
curl --request GET \
--url https://api.cleverhub.co/api/v2/contacts/all \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>'import requests
url = "https://api.cleverhub.co/api/v2/contacts/all"
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'app-id': '<api-key>', 'secret-key': '<api-key>'}};
fetch('https://api.cleverhub.co/api/v2/contacts/all', 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/contacts/all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.cleverhub.co/api/v2/contacts/all"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cleverhub.co/api/v2/contacts/all")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleverhub.co/api/v2/contacts/all")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"total": 100,
"page": 1,
"per_page": 20,
"records": [
{
"email": "test@example.com",
"first_name": "Luyx",
"last_name": "Tran",
"type": "individual",
"dob": "1991-12-24",
"phone": "+6123224242",
"reg_no": "123456789",
"gender": "male",
"street": "338 George Street",
"city": "Sydney",
"postal_code": "2000",
"state": "New South Wales",
"country": "AU",
"identity": {
"issue_country": "AU",
"document_number": "12345678",
"issue_date": "2024-04-16",
"expiry_date": "2024-04-16",
"id_doc_type": "Passport"
},
"kyc_statuses": [
{
"kyc_status": "approved",
"message": "null"
},
{
"kyc_status": "rejected",
"message": "KYC is rejected."
}
]
}
]
}{
"errors": {
"code": "BAD_REQUEST",
"message": "Invalid query parameters."
}
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorized"
}
}Authorizations
A unique identifier assigned to each application.
A secure token associated with the app-id.
Query Parameters
Start date to query contact requests from, format 'DD/MM/YY' or 'YYYY-MM-DDThh:mm:ss'. This datetime would be in UTC timezone
End date to query contact requests, format 'DD/MM/YY' or 'YYYY-MM-DDThh:mm:ss'. The datetime would be in UTC timezone
Page number to query. Currently we support 20 records per page.
Default 20 records per page.
Get Contact Requests in a Period of Time
curl --request GET \
--url https://api.cleverhub.co/api/v2/contacts/all \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>'import requests
url = "https://api.cleverhub.co/api/v2/contacts/all"
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'app-id': '<api-key>', 'secret-key': '<api-key>'}};
fetch('https://api.cleverhub.co/api/v2/contacts/all', 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/contacts/all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.cleverhub.co/api/v2/contacts/all"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cleverhub.co/api/v2/contacts/all")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleverhub.co/api/v2/contacts/all")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"total": 100,
"page": 1,
"per_page": 20,
"records": [
{
"email": "test@example.com",
"first_name": "Luyx",
"last_name": "Tran",
"type": "individual",
"dob": "1991-12-24",
"phone": "+6123224242",
"reg_no": "123456789",
"gender": "male",
"street": "338 George Street",
"city": "Sydney",
"postal_code": "2000",
"state": "New South Wales",
"country": "AU",
"identity": {
"issue_country": "AU",
"document_number": "12345678",
"issue_date": "2024-04-16",
"expiry_date": "2024-04-16",
"id_doc_type": "Passport"
},
"kyc_statuses": [
{
"kyc_status": "approved",
"message": "null"
},
{
"kyc_status": "rejected",
"message": "KYC is rejected."
}
]
}
]
}{
"errors": {
"code": "BAD_REQUEST",
"message": "Invalid query parameters."
}
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorized"
}
}