Get field values on a single Person
curl --request GET \
--url https://api.affinity.co/v2/persons/{personId}/fields \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/persons/{personId}/fields"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.affinity.co/v2/persons/{personId}/fields', 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.affinity.co/v2/persons/{personId}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.affinity.co/v2/persons/{personId}/fields"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.affinity.co/v2/persons/{personId}/fields")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/persons/{personId}/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"enrichmentSource": "affinity-data",
"value": {
"type": "location",
"data": {
"streetAddress": null,
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America"
}
}
},
{
"id": "affinity-data-linkedin-url",
"name": "LinkedIn URL",
"type": "enriched",
"enrichmentSource": "affinity-data",
"value": {
"type": "text",
"data": "https://linkedin.com/in/alex-rivera"
}
}
],
"pagination": {
"prevUrl": "https://api.affinity.co/v2/persons/1/fields?types=enriched&cursor=ICAgICAgYmVmb3JlOjo6Nw",
"nextUrl": "https://api.affinity.co/v2/persons/1/fields?types=enriched&cursor=ICAgICAgIGFmdGVyOjo6NA"
}
}Persons
Get field values on a single Person
| ⚠️ This endpoint is currently in BETA |
|---|
Paginate through field values on a single person.
Enriched, global, and relationship-intelligence fields will be included by default. The ids and types parameters can be used to filter
the collection. These parameters are mutually exclusive.
List fields are not returned by this endpoint. To retrieve or update list field values, use the list entry fields endpoints.
GET
/
v2
/
persons
/
{personId}
/
fields
Get field values on a single Person
curl --request GET \
--url https://api.affinity.co/v2/persons/{personId}/fields \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/persons/{personId}/fields"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.affinity.co/v2/persons/{personId}/fields', 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.affinity.co/v2/persons/{personId}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.affinity.co/v2/persons/{personId}/fields"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.affinity.co/v2/persons/{personId}/fields")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/persons/{personId}/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"enrichmentSource": "affinity-data",
"value": {
"type": "location",
"data": {
"streetAddress": null,
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America"
}
}
},
{
"id": "affinity-data-linkedin-url",
"name": "LinkedIn URL",
"type": "enriched",
"enrichmentSource": "affinity-data",
"value": {
"type": "text",
"data": "https://linkedin.com/in/alex-rivera"
}
}
],
"pagination": {
"prevUrl": "https://api.affinity.co/v2/persons/1/fields?types=enriched&cursor=ICAgICAgYmVmb3JlOjo6Nw",
"nextUrl": "https://api.affinity.co/v2/persons/1/fields?types=enriched&cursor=ICAgICAgIGFmdGVyOjo6NA"
}
}Authorizations
A static Affinity API key, presented as a bearer token.
Path Parameters
Person ID
Required range:
1 <= x <= 9007199254740991Query Parameters
Field IDs for which to return field data
Example:
["field-1"]
Field Types for which to return field data
Available options:
enriched, global, relationship-intelligence Cursor for the next or previous page
Example:
"ICAgICAgYmVmb3JlOjo6Nw"
Number of items to include in the page
Required range:
1 <= x <= 100Example:
20
Was this page helpful?