Get Contact by ID
curl --request GET \
--url https://api.clemta.com/contacts/{contact_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.clemta.com/contacts/{contact_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.clemta.com/contacts/{contact_id}', 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.clemta.com/contacts/{contact_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-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.clemta.com/contacts/{contact_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-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.clemta.com/contacts/{contact_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clemta.com/contacts/{contact_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Contact retrieved successfully",
"data": {
"id": "64b8f1a2e4b0c8d9f0123456",
"created_at": 1640995200,
"updated_at": 1640995200,
"type": "customer",
"status": "active",
"full_name": "John Doe",
"email": "[email protected]",
"description": "Primary contact for the company",
"cc_emails": [
"[email protected]",
"[email protected]"
],
"bcc_emails": [
"[email protected]",
"[email protected]"
],
"billing": {
"email": "[email protected]",
"phone": "1234567890",
"phone_code": "+1",
"iso_code": "US",
"country": "United States",
"address_1": "123 Main Street",
"address_2": "Suite 100",
"postal_code": "12345",
"district": "Downtown",
"state": "CA",
"province": "California",
"tax_id": "12-3456789"
}
}
}{
"success": false,
"message": "Invalid request data",
"data": null,
"error": {
"code": "INVALID_REQUEST",
"details": "Field 'name' is required"
}
}{
"success": false,
"message": "API key is required",
"data": null,
"error": {
"code": "API_KEY_REQUIRED",
"details": ""
}
}{
"success": false,
"message": "Contact not found",
"data": null,
"error": {
"code": "NOT_FOUND",
"details": ""
}
}{
"success": false,
"message": "Internal server error",
"data": null,
"error": {
"code": "INTERNAL_ERROR",
"details": "An unexpected error occurred."
}
}Contacts API
Get Contact by ID
Retrieve a specific contact by its ID
GET
/
contacts
/
{contact_id}
Get Contact by ID
curl --request GET \
--url https://api.clemta.com/contacts/{contact_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.clemta.com/contacts/{contact_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.clemta.com/contacts/{contact_id}', 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.clemta.com/contacts/{contact_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-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.clemta.com/contacts/{contact_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-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.clemta.com/contacts/{contact_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clemta.com/contacts/{contact_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Contact retrieved successfully",
"data": {
"id": "64b8f1a2e4b0c8d9f0123456",
"created_at": 1640995200,
"updated_at": 1640995200,
"type": "customer",
"status": "active",
"full_name": "John Doe",
"email": "[email protected]",
"description": "Primary contact for the company",
"cc_emails": [
"[email protected]",
"[email protected]"
],
"bcc_emails": [
"[email protected]",
"[email protected]"
],
"billing": {
"email": "[email protected]",
"phone": "1234567890",
"phone_code": "+1",
"iso_code": "US",
"country": "United States",
"address_1": "123 Main Street",
"address_2": "Suite 100",
"postal_code": "12345",
"district": "Downtown",
"state": "CA",
"province": "California",
"tax_id": "12-3456789"
}
}
}{
"success": false,
"message": "Invalid request data",
"data": null,
"error": {
"code": "INVALID_REQUEST",
"details": "Field 'name' is required"
}
}{
"success": false,
"message": "API key is required",
"data": null,
"error": {
"code": "API_KEY_REQUIRED",
"details": ""
}
}{
"success": false,
"message": "Contact not found",
"data": null,
"error": {
"code": "NOT_FOUND",
"details": ""
}
}{
"success": false,
"message": "Internal server error",
"data": null,
"error": {
"code": "INTERNAL_ERROR",
"details": "An unexpected error occurred."
}
}Get Contact by ID
This endpoint allows you to retrieve a specific contact by its ID.Headers
| Parameter | Type | Description |
|---|---|---|
| X-API-KEY | string | Formation API Key (required) |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| contact_id | string | Contact ID (required) |
Parameter Examples
- Contact ID:
64b8f1a2e4b0c8d9f0123456
Response
{
"success": true,
"message": "Contact retrieved successfully",
"data": {
"id": "64b8f1a2e4b0c8d9f0123456",
"created_at": 1686787200,
"updated_at": 1686787200,
"type": "customer",
"status": "active",
"full_name": "John Doe",
"email": "[email protected]",
"description": "Primary customer contact",
"cc_emails": ["[email protected]"],
"bcc_emails": ["[email protected]"],
"billing": {
"email": "[email protected]",
"phone": "+1234567890",
"phone_code": "+1",
"iso_code": "US",
"country": "United States",
"address_1": "123 Main St",
"address_2": "Suite 100",
"postal_code": "12345",
"district": "Downtown",
"state": "CA",
"province": "California",
"tax_id": "12-3456789"
}
}
}
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| success | boolean | Indicates if the operation was successful |
| message | string | Additional information about the operation |
| data | object | Response data for successful requests |
| data.id | string | Unique identifier for the contact |
| data.created_at | integer | Creation timestamp |
| data.updated_at | integer | Last update timestamp |
| data.type | string | Contact type (“customer” or “vendor”) |
| data.status | string | Contact status |
| data.full_name | string | Full name of the contact |
| data.email | string | Email address |
| data.description | string | Contact description |
| data.cc_emails | array | CC email addresses |
| data.bcc_emails | array | BCC email addresses |
| data.billing | object | Billing information |
Billing Object Fields
| Field | Type | Description |
|---|---|---|
| string | Billing email address | |
| phone | string | Phone number |
| phone_code | string | Phone country code |
| iso_code | string | Country ISO code |
| country | string | Country name |
| address_1 | string | Address line 1 |
| address_2 | string | Address line 2 |
| postal_code | string | Postal code |
| district | string | District |
| state | string | State |
| province | string | Province |
| tax_id | string | Tax identification number |
Error Responses
Invalid Request (400)
{
"success": false,
"message": "Invalid request data",
"error": {
"code": "INVALID_REQUEST",
"details": "Invalid contact ID format"
}
}
Unauthorized (401)
{
"success": false,
"message": "API key is required",
"error": {
"code": "API_KEY_REQUIRED"
}
}
Contact Not Found (404)
{
"success": false,
"message": "Contact not found",
"error": {
"code": "CONTACT_NOT_FOUND"
}
}
Internal Server Error (500)
{
"success": false,
"message": "Internal server error",
"error": {
"code": "INTERNAL_ERROR"
}
}
Authorizations
Formation API key for authentication.
Path Parameters
Contact ID
Response
Contact retrieved successfully
Example:
true
Example:
"Contact retrieved successfully"
Show child attributes
Show child attributes
Example:
{
"id": "64b8f1a2e4b0c8d9f0123456",
"created_at": 1640995200,
"updated_at": 1640995200,
"type": "customer",
"status": "active",
"full_name": "John Doe",
"email": "[email protected]",
"description": "Primary contact for the company",
"cc_emails": ["[email protected]", "[email protected]"],
"bcc_emails": ["[email protected]", "[email protected]"],
"billing": {
"email": "[email protected]",
"phone": "1234567890",
"phone_code": "+1",
"iso_code": "US",
"country": "United States",
"address_1": "123 Main Street",
"address_2": "Suite 100",
"postal_code": "12345",
"district": "Downtown",
"state": "CA",
"province": "California",
"tax_id": "12-3456789"
}
}
⌘I