Get a single field value on a Company
curl --request GET \
--url https://api.affinity.co/v2/companies/{companyId}/fields/{fieldId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/companies/{companyId}/fields/{fieldId}"
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/companies/{companyId}/fields/{fieldId}', 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/companies/{companyId}/fields/{fieldId}",
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/companies/{companyId}/fields/{fieldId}"
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/companies/{companyId}/fields/{fieldId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/companies/{companyId}/fields/{fieldId}")
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": "field-1",
"name": "Field with company value",
"type": "global",
"enrichmentSource": null,
"value": {
"type": "company",
"data": {
"id": 1,
"name": "Horizon Technologies",
"domain": "horizontech.com"
}
}
}Companies
Get a single field value on a Company
| ⚠️ This endpoint is currently in BETA |
|---|
Retrieve a single field on a company. Returns basic information and the field value.
GET
/
v2
/
companies
/
{companyId}
/
fields
/
{fieldId}
Get a single field value on a Company
curl --request GET \
--url https://api.affinity.co/v2/companies/{companyId}/fields/{fieldId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/companies/{companyId}/fields/{fieldId}"
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/companies/{companyId}/fields/{fieldId}', 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/companies/{companyId}/fields/{fieldId}",
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/companies/{companyId}/fields/{fieldId}"
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/companies/{companyId}/fields/{fieldId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/companies/{companyId}/fields/{fieldId}")
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": "field-1",
"name": "Field with company value",
"type": "global",
"enrichmentSource": null,
"value": {
"type": "company",
"data": {
"id": 1,
"name": "Horizon Technologies",
"domain": "horizontech.com"
}
}
}Authorizations
A static Affinity API key, presented as a bearer token.
Path Parameters
Company ID
Required range:
1 <= x <= 9007199254740991Field ID
Examples:
"affinity-data-location"
"field-1234"
Response
OK
The field's unique identifier
Example:
"affinity-data-location"
The field's name
Example:
"Location"
The field's category. hidden is a redaction state rather than a category: it signals a field on a restricted opportunity the caller cannot manage, whose value is masked.
Available options:
enriched, global, list, relationship-intelligence, hidden Example:
"enriched"
The source of the data in this Field (if it is enriched)
Available options:
affinity-data, dealroom, eventbrite, mailchimp, null Example:
"affinity-data"
- CompaniesValue
- CompanyValue
- DateValue
- DropdownsValue
- DropdownValue
- FloatsValue
- FloatValue
- FormulaValue
- InteractionValue
- ListsValue
- LocationsValue
- LocationValue
- NoteValue
- PersonsValue
- PersonValue
- RankedDropdownValue
- ReminderValue
- TextsValue
- TextValue
Show child attributes
Show child attributes
Example:
{
"type": "company-multi",
"data": [
{
"id": 1,
"name": "Horizon Technologies",
"domain": "horizontech.com"
},
{
"id": 2,
"name": "Crestwood Capital",
"domain": "crestwoodcap.com"
}
]
}
Was this page helpful?