curl --request GET \
--url https://api.affinity.co/v2/persons/{personId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/persons/{personId}"
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}', 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}",
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}"
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}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/persons/{personId}")
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{
"id": 1,
"firstName": "Jane",
"lastName": "Doe",
"primaryEmailAddress": "jane.smith@northpointvc.com",
"emailAddresses": [
"jane.smith@northpointvc.com",
"janedoe@gmail.com"
],
"type": "internal",
"fields": [
{
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"enrichmentSource": "affinity-data",
"value": {
"type": "company-multi",
"data": [
{
"id": 1,
"name": "Horizon Technologies",
"domain": "horizontech.com"
},
{
"id": 2,
"name": "Crestwood Capital",
"domain": "crestwoodcap.com"
}
]
}
}
]
}{
"errors": [
{
"code": "bad-request",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authorization",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "not-found",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authentication",
"message": "<string>"
}
]
}Get a single Person
Returns basic information and non-list-specific field data on the requested 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.
curl --request GET \
--url https://api.affinity.co/v2/persons/{personId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/persons/{personId}"
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}', 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}",
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}"
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}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/persons/{personId}")
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{
"id": 1,
"firstName": "Jane",
"lastName": "Doe",
"primaryEmailAddress": "jane.smith@northpointvc.com",
"emailAddresses": [
"jane.smith@northpointvc.com",
"janedoe@gmail.com"
],
"type": "internal",
"fields": [
{
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"enrichmentSource": "affinity-data",
"value": {
"type": "company-multi",
"data": [
{
"id": 1,
"name": "Horizon Technologies",
"domain": "horizontech.com"
},
{
"id": 2,
"name": "Crestwood Capital",
"domain": "crestwoodcap.com"
}
]
}
}
]
}{
"errors": [
{
"code": "bad-request",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authorization",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "not-found",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authentication",
"message": "<string>"
}
]
}Authorizations
A static Affinity API key, presented as a bearer token.
Path Parameters
Person ID
1 <= x <= 9007199254740991Query Parameters
Field IDs for which to return field data
["field-1"]
Field Types for which to return field data
enriched, global, relationship-intelligence Response
OK
Person model
The persons's unique identifier
1 <= x <= 90071992547409911
The person's first name
"Jane"
The person's last name
"Doe"
The person's primary email address
"jane.smith@northpointvc.com"
All of the person's email addresses
[ "jane.smith@northpointvc.com", "janedoe@gmail.com" ]
The person's type. internal - people who are users within your Affinity instance. external - people who are not internal.
internal, external "internal"
The fields associated with the person
Show child attributes
Show child attributes
Was this page helpful?