Get all Persons
curl --request GET \
--url https://api.affinity.co/v2/persons \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/persons"
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', 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",
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"
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")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/persons")
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": 1,
"firstName": "Jane",
"lastName": "Smith",
"primaryEmailAddress": "jane.smith@northpointvc.com",
"emailAddresses": [
"jane.smith@northpointvc.com"
],
"type": "internal",
"fields": []
},
{
"id": 2,
"firstName": "Michael",
"lastName": "Torres",
"primaryEmailAddress": "m.torres@northpointvc.com",
"emailAddresses": [
"m.torres@northpointvc.com"
],
"type": "external",
"fields": []
}
],
"pagination": {
"prevUrl": "https://api.affinity.co/v2/persons?cursor=ICAgICAgYmVmb3JlOjo6Nw",
"nextUrl": "https://api.affinity.co/v2/persons?cursor=ICAgICAgIGFmdGVyOjo6NA"
}
}{
"errors": [
{
"code": "bad-request",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authorization",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authentication",
"message": "<string>"
}
]
}Persons
Get all Persons
Paginate through Persons in Affinity. Returns basic information and non-list-specific field data on each Person.
To retrieve field data, you must use either the fieldIds or the fieldTypes parameter
to specify the Fields for which you want data returned.
These Field IDs and Types can be found using the GET /v2/persons/fields endpoint.
When no fieldIds or fieldTypes are provided, Persons will be returned without any field data attached.
To supply multiple fieldIds or fieldTypes parameters, generate a query string that looks like this:
?fieldIds=field-1234&fieldIds=affinity-data-location or ?fieldTypes=enriched&fieldTypes=global.
Requires the “Export All People directory” permission.
GET
/
v2
/
persons
Get all Persons
curl --request GET \
--url https://api.affinity.co/v2/persons \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/persons"
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', 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",
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"
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")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/persons")
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": 1,
"firstName": "Jane",
"lastName": "Smith",
"primaryEmailAddress": "jane.smith@northpointvc.com",
"emailAddresses": [
"jane.smith@northpointvc.com"
],
"type": "internal",
"fields": []
},
{
"id": 2,
"firstName": "Michael",
"lastName": "Torres",
"primaryEmailAddress": "m.torres@northpointvc.com",
"emailAddresses": [
"m.torres@northpointvc.com"
],
"type": "external",
"fields": []
}
],
"pagination": {
"prevUrl": "https://api.affinity.co/v2/persons?cursor=ICAgICAgYmVmb3JlOjo6Nw",
"nextUrl": "https://api.affinity.co/v2/persons?cursor=ICAgICAgIGFmdGVyOjo6NA"
}
}{
"errors": [
{
"code": "bad-request",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authorization",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authentication",
"message": "<string>"
}
]
}Authorizations
Query Parameters
Was this page helpful?