Service endpoint¶
https://api.targetsmart.com/person/phone-search
Overview¶
This service can be used to enrich a list of phone numbers with TargetSmart data. The service provides high performance for single record lookups and batch requests. A common use-case is to match a contact book for enrichment with TargetSmart data. The corresponding JSON response includes the TargetSmart data field values from our platform database. TargetSmart Client Services configures the returned field identifiers for your key. The request is executed synchronously with low latency.
Request Parameters¶
Key | Required | Optional | Default | Permitted Values |
---|---|---|---|---|
phones |
✓ | A comma separated list of up to 500 valid phone numbers |
Additional Parameter Details¶
This service returns fields based on configured person/data-enhance fields.
phones
A comma separated list (no spaces) of 10 digit phone numbers.
JSON Response¶
Responses are JSON objects with the following keys:
states_updated
: Voter file update date information represented as a JSON object where keys are two character U.S. state codes and values are dates the state voter file was last updated. The date format is YYYYMMDD.result
: A list of JSON objects mapping field names to data values for each input phone number
An example response (Note: Your responses will have different data fields based on your configuration):
'result': [
{'vb.voterbase_id': 'NY-123456',
'vb.vf_source_state': 'NY',
'vb.tsmart_first_name': 'John',
'vb.tsmart_last_name': 'Doe'},
...
]
Code Examples¶
🔐 Remember to secure your API key
Never expose your API key in plain text or source control accessible by a third party.
#! /usr/bin/env python3
import os
import requests
api_key = os.environ["TS_API_KEY"]
# `point` query
response = requests.get(
"https://api.targetsmart.com/person/phone-search",
params={"phones": "1112223333,4445556666"},
headers={"x-api-key": api_key},
)
response.raise_for_status()
print(response.json())
#! /usr/bin/env node
const fetch = require("node-fetch");
const targetSmartApiKey = process.env.TS_API_KEY;
const queryParams = new URLSearchParams({
phones: "1112223333,4445556666",
});
fetch(
"https://api.targetsmart.com/person/phone-search?" + queryParams.toString(),
{
method: "GET",
headers: {
"x-api-key": targetSmartApiKey,
},
}
)
.then((res) => res.json())
.then((json) => console.log(json));
#! /usr/bin/env bash
result=$(curl -XGET \
-H "x-api-key: $TS_API_KEY" \
"https://api.targetsmart.com/person/phones-search?phones=1112223333%2C4445556666")
echo $result