curl --request GET \
--url https://api.affinity.co/v2/persons/fields \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/persons/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/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/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/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/fields")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/persons/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-current-job-title",
"name": "Current Job Title",
"type": "enriched",
"valueType": "filterable-text",
"enrichmentSource": "affinity-data",
"createdAt": "2024-03-07T20:21:42Z"
},
{
"id": "affinity-data-industry",
"name": "Industry",
"type": "enriched",
"valueType": "filterable-text-multi",
"enrichmentSource": "affinity-data",
"createdAt": "2024-03-07T20:21:42Z"
},
{
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"valueType": "location",
"enrichmentSource": "affinity-data",
"createdAt": "2024-03-07T20:21:42Z"
},
{
"id": "field-1",
"name": "Custom global field",
"type": "global",
"valueType": "text",
"enrichmentSource": null,
"createdAt": "2024-03-07T20:21:42Z"
},
{
"id": "last-email",
"name": "Last Email",
"type": "relationship-intelligence",
"valueType": "interaction",
"enrichmentSource": null,
"createdAt": null
},
{
"id": "lists",
"name": "Lists",
"type": "global",
"valueType": "list-multi",
"enrichmentSource": null,
"createdAt": null
},
{
"id": "notes",
"name": "Notes",
"type": "global",
"valueType": "note",
"enrichmentSource": null,
"createdAt": null
},
{
"id": "reminders",
"name": "Reminders",
"type": "global",
"valueType": "reminder",
"enrichmentSource": null,
"createdAt": null
},
{
"id": "source-of-introduction",
"name": "Source of Introduction",
"type": "relationship-intelligence",
"valueType": "person",
"enrichmentSource": null,
"createdAt": "2024-03-07T20:21:42Z"
}
],
"pagination": {
"prevUrl": null,
"nextUrl": "https://api.affinity.co/v2/persons/fields?cursor=ICAgICAgIGFmdGVyOjo6NA"
}
}Get metadata on Person Fields
Returns metadata on non-list-specific Person Fields.
Use the returned Field IDs to request field data from the GET /v2/persons and GET /v2/persons/{id} endpoints.
You can filter Fields using the filter query parameter. The filter parameter is a string that you can specify conditions based on the following properties.
| Property Name | Type | Allowed Operators | Examples |
|---|---|---|---|
name | text | =, =~ | name="Location", name=~loc |
Use the includes query parameter to add optional metadata to each Field in the response. Pass includes more than once to request multiple values.
| Value | Adds to each Field |
|---|---|
filterability | How the field can be used in filter expressions on GET /v2/persons and POST /v2/persons/search |
sortability | How the field can be used in sort expressions on those endpoints |
Example: GET /v2/persons/fields?includes=filterability&includes=sortability
curl --request GET \
--url https://api.affinity.co/v2/persons/fields \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/persons/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/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/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/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/fields")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/persons/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-current-job-title",
"name": "Current Job Title",
"type": "enriched",
"valueType": "filterable-text",
"enrichmentSource": "affinity-data",
"createdAt": "2024-03-07T20:21:42Z"
},
{
"id": "affinity-data-industry",
"name": "Industry",
"type": "enriched",
"valueType": "filterable-text-multi",
"enrichmentSource": "affinity-data",
"createdAt": "2024-03-07T20:21:42Z"
},
{
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"valueType": "location",
"enrichmentSource": "affinity-data",
"createdAt": "2024-03-07T20:21:42Z"
},
{
"id": "field-1",
"name": "Custom global field",
"type": "global",
"valueType": "text",
"enrichmentSource": null,
"createdAt": "2024-03-07T20:21:42Z"
},
{
"id": "last-email",
"name": "Last Email",
"type": "relationship-intelligence",
"valueType": "interaction",
"enrichmentSource": null,
"createdAt": null
},
{
"id": "lists",
"name": "Lists",
"type": "global",
"valueType": "list-multi",
"enrichmentSource": null,
"createdAt": null
},
{
"id": "notes",
"name": "Notes",
"type": "global",
"valueType": "note",
"enrichmentSource": null,
"createdAt": null
},
{
"id": "reminders",
"name": "Reminders",
"type": "global",
"valueType": "reminder",
"enrichmentSource": null,
"createdAt": null
},
{
"id": "source-of-introduction",
"name": "Source of Introduction",
"type": "relationship-intelligence",
"valueType": "person",
"enrichmentSource": null,
"createdAt": "2024-03-07T20:21:42Z"
}
],
"pagination": {
"prevUrl": null,
"nextUrl": "https://api.affinity.co/v2/persons/fields?cursor=ICAgICAgIGFmdGVyOjo6NA"
}
}Authorizations
A static Affinity API key, presented as a bearer token.
Query Parameters
Cursor for the next or previous page
Number of items to include in the page
1 <= x <= 100100
Filter options
Additional properties to include in the response
filterability, sortability Was this page helpful?