curl --request GET \
--url "https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US" \
--header "x-api-key: YOUR_API_KEY" \
--header "Accept: application/json"
const response = await fetch(
"https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US",
{
headers: {
"x-api-key": "YOUR_API_KEY",
Accept: "application/json",
},
}
);
const data = await response.json();
import axios from "axios";
const { data } = await axios.get(
"https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US",
{
headers: {
"x-api-key": "YOUR_API_KEY",
Accept: "application/json",
},
}
);
console.log(data);
import requests
headers = {
"x-api-key": "YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.get(
"https://api.trestleiq.com/3.1/cnam",
params={"phone": "2069735100", "phone.country_hint": "US"},
headers=headers,
timeout=30,
)
data = response.json()
print(data)
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
client.DefaultRequestHeaders.Add("Accept", "application/json");
var response = await client.GetAsync("https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US");
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US", nil)
req.Header.Set("x-api-key", "YOUR_API_KEY")
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
<?php
$curl = curl_init("https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US");
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"x-api-key: YOUR_API_KEY",
"Accept: application/json"
]);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class SmartCnamExample {
public static void main(String[] args) throws Exception {
HttpRequest request =
HttpRequest.newBuilder()
.uri(URI.create("https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US"))
.header("x-api-key", "YOUR_API_KEY")
.header("Accept", "application/json")
.GET()
.build();
HttpResponse<String> response =
HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
{
"id": "Phone.3dbb6fef-a2df-4b08-cfe3-bc7128b6f5b4",
"is_valid": true,
"belongs_to": {
"id": "Person.fffdcf06-0929-4b5a-9921-ee49b101ca84",
"name": "Waidong L Syrws",
"firstname": "Waidong",
"middlename": "L",
"lastname": "Syrws"
},
"error": {
"name": "InternalError",
"message": "Could not retrieve entire response"
},
"add_ons": {
"spam_checks": {
"phone.is_spam": true
}
},
"warnings": [
"Missing Input"
]
}
curl --request GET \
--url "https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US" \
--header "x-api-key: YOUR_API_KEY" \
--header "Accept: application/json"
const response = await fetch(
"https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US",
{
headers: {
"x-api-key": "YOUR_API_KEY",
Accept: "application/json",
},
}
);
const data = await response.json();
import axios from "axios";
const { data } = await axios.get(
"https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US",
{
headers: {
"x-api-key": "YOUR_API_KEY",
Accept: "application/json",
},
}
);
console.log(data);
import requests
headers = {
"x-api-key": "YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.get(
"https://api.trestleiq.com/3.1/cnam",
params={"phone": "2069735100", "phone.country_hint": "US"},
headers=headers,
timeout=30,
)
data = response.json()
print(data)
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
client.DefaultRequestHeaders.Add("Accept", "application/json");
var response = await client.GetAsync("https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US");
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US", nil)
req.Header.Set("x-api-key", "YOUR_API_KEY")
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
<?php
$curl = curl_init("https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US");
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"x-api-key: YOUR_API_KEY",
"Accept: application/json"
]);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class SmartCnamExample {
public static void main(String[] args) throws Exception {
HttpRequest request =
HttpRequest.newBuilder()
.uri(URI.create("https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US"))
.header("x-api-key", "YOUR_API_KEY")
.header("Accept", "application/json")
.GET()
.build();
HttpResponse<String> response =
HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
{
"id": "Phone.3dbb6fef-a2df-4b08-cfe3-bc7128b6f5b4",
"is_valid": true,
"belongs_to": {
"id": "Person.fffdcf06-0929-4b5a-9921-ee49b101ca84",
"name": "Waidong L Syrws",
"firstname": "Waidong",
"middlename": "L",
"lastname": "Syrws"
},
"error": {
"name": "InternalError",
"message": "Could not retrieve entire response"
},
"add_ons": {
"spam_checks": {
"phone.is_spam": true
}
},
"warnings": [
"Missing Input"
]
}
Smart CNAM API
Smart CNAM API Documentation
Smart CNAM API Documentation: Validate a phone number and return the person or business name for caller ID and CNAM lookup use cases.
curl --request GET \
--url "https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US" \
--header "x-api-key: YOUR_API_KEY" \
--header "Accept: application/json"
const response = await fetch(
"https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US",
{
headers: {
"x-api-key": "YOUR_API_KEY",
Accept: "application/json",
},
}
);
const data = await response.json();
import axios from "axios";
const { data } = await axios.get(
"https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US",
{
headers: {
"x-api-key": "YOUR_API_KEY",
Accept: "application/json",
},
}
);
console.log(data);
import requests
headers = {
"x-api-key": "YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.get(
"https://api.trestleiq.com/3.1/cnam",
params={"phone": "2069735100", "phone.country_hint": "US"},
headers=headers,
timeout=30,
)
data = response.json()
print(data)
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
client.DefaultRequestHeaders.Add("Accept", "application/json");
var response = await client.GetAsync("https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US");
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US", nil)
req.Header.Set("x-api-key", "YOUR_API_KEY")
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
<?php
$curl = curl_init("https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US");
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"x-api-key: YOUR_API_KEY",
"Accept: application/json"
]);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class SmartCnamExample {
public static void main(String[] args) throws Exception {
HttpRequest request =
HttpRequest.newBuilder()
.uri(URI.create("https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US"))
.header("x-api-key", "YOUR_API_KEY")
.header("Accept", "application/json")
.GET()
.build();
HttpResponse<String> response =
HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
{
"id": "Phone.3dbb6fef-a2df-4b08-cfe3-bc7128b6f5b4",
"is_valid": true,
"belongs_to": {
"id": "Person.fffdcf06-0929-4b5a-9921-ee49b101ca84",
"name": "Waidong L Syrws",
"firstname": "Waidong",
"middlename": "L",
"lastname": "Syrws"
},
"error": {
"name": "InternalError",
"message": "Could not retrieve entire response"
},
"add_ons": {
"spam_checks": {
"phone.is_spam": true
}
},
"warnings": [
"Missing Input"
]
}
curl --request GET \
--url "https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US" \
--header "x-api-key: YOUR_API_KEY" \
--header "Accept: application/json"
const response = await fetch(
"https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US",
{
headers: {
"x-api-key": "YOUR_API_KEY",
Accept: "application/json",
},
}
);
const data = await response.json();
import axios from "axios";
const { data } = await axios.get(
"https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US",
{
headers: {
"x-api-key": "YOUR_API_KEY",
Accept: "application/json",
},
}
);
console.log(data);
import requests
headers = {
"x-api-key": "YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.get(
"https://api.trestleiq.com/3.1/cnam",
params={"phone": "2069735100", "phone.country_hint": "US"},
headers=headers,
timeout=30,
)
data = response.json()
print(data)
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
client.DefaultRequestHeaders.Add("Accept", "application/json");
var response = await client.GetAsync("https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US");
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US", nil)
req.Header.Set("x-api-key", "YOUR_API_KEY")
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
<?php
$curl = curl_init("https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US");
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"x-api-key: YOUR_API_KEY",
"Accept: application/json"
]);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class SmartCnamExample {
public static void main(String[] args) throws Exception {
HttpRequest request =
HttpRequest.newBuilder()
.uri(URI.create("https://api.trestleiq.com/3.1/cnam?phone=2069735100&phone.country_hint=US"))
.header("x-api-key", "YOUR_API_KEY")
.header("Accept", "application/json")
.GET()
.build();
HttpResponse<String> response =
HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
{
"id": "Phone.3dbb6fef-a2df-4b08-cfe3-bc7128b6f5b4",
"is_valid": true,
"belongs_to": {
"id": "Person.fffdcf06-0929-4b5a-9921-ee49b101ca84",
"name": "Waidong L Syrws",
"firstname": "Waidong",
"middlename": "L",
"lastname": "Syrws"
},
"error": {
"name": "InternalError",
"message": "Could not retrieve entire response"
},
"add_ons": {
"spam_checks": {
"phone.is_spam": true
}
},
"warnings": [
"Missing Input"
]
}
Smart CNAM API 3.1
GET https://api.trestleiq.com/3.1/cnam?api_key=[insert_key]&phone=[insert_phone_number]
Query Parameters
string
required
The phone number in E.164 or local format. Example:
phone=2069735100string (ISO-3166-2)
The ISO-3166 alpha-2 country code of the phone number. See: ISO-3166. Example:
phone.country_hint=USstring
Request parameter to enable specific add-ons available for this endpoint. Add-ons incur additional charges. Please see here for more details.
- spam_checks: to enable spam and scam detection checks in the response
spam_checksHeaders
string
required
Your API key for authentication. Example:
{{ apiKey }}Response
string or null <Phone.<uuid>>
The persistent ID of the phone number.
boolean or null
True if the phone number is valid.
(PhoneOwnerPersonSmartCNAM (object or null))
The primary owner of the phone number.
Show belongs_to object
Show belongs_to object
object(PartialError)
object or null
string[]
Warnings returned as part of the response, if applicable.
Enum: Invalid Input International number. Not authorized Missing Input
Enum: Invalid Input International number. Not authorized Missing Input
Error Responses
400 Bad Request
The server cannot process the request due to client-side errors.Check for: Syntax errors in the request script, malformed JSON, or invalid parameters.403 Forbidden
The request is understood, but the server is refusing to fulfill it. Error responses include anerrorCode field identifying the cause:-
Invalid API Key (
AUTHENTICATION_FAILED): The key is incorrect, deactivated, or missing from the request. Check for: Trailing spaces, syntax errors, incorrect character counts, or a missingx-api-keyheader. -
API Key Disabled (Portal Issue) (
AUTHENTICATION_FAILED): The key is inactive. Check for: Insufficient funds in your self-serve wallet or if a Trestle Admin manually deactivated your API key. -
API Key does not have Product Access (Portal Issue) (
AUTHENTICATION_FAILED): The API key is active, but it is not enabled for this product or API version. Check for: Incorrect endpoint, incorrect API version, or missing product access on the key. -
API Key Expired (
AUTHENTICATION_FAILED): The key has reached its end-of-life (primarily affects Trial users).
429 Too Many Requests
You have sent too many requests in a given amount of time.-
Rate Limit Exceeded (
RATE_LIMIT_EXCEEDED): You have surpassed the queries-per-second (QPS) threshold for your tier. -
Quota Exceeded (Portal Issue) (
QUOTA_EXCEEDED): You have reached the total volume allowed for your current billing cycle. Upgrade your plan in the portal to resume service.
