Get dropdown options for a Company Field
curl --request GET \
--url https://api.affinity.co/v2/companies/fields/{fieldId}/dropdown-options \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/companies/fields/{fieldId}/dropdown-options"
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/fields/{fieldId}/dropdown-options', 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/fields/{fieldId}/dropdown-options",
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/fields/{fieldId}/dropdown-options"
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/fields/{fieldId}/dropdown-options")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/companies/fields/{fieldId}/dropdown-options")
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": [
{
"type": "dropdown",
"id": 1,
"text": "Seed"
},
{
"type": "dropdown",
"id": 2,
"text": "Series A"
},
{
"type": "dropdown",
"id": 3,
"text": "Series B"
}
],
"pagination": {
"prevUrl": null,
"nextUrl": null
}
}Companies
Get dropdown options for a Company Field
Returns the dropdown options for a specific dropdown or ranked-dropdown field on a Company.
Use the returned dropdown option IDs when writing dropdown field values via the field update endpoints.
GET
/
v2
/
companies
/
fields
/
{fieldId}
/
dropdown-options
Get dropdown options for a Company Field
curl --request GET \
--url https://api.affinity.co/v2/companies/fields/{fieldId}/dropdown-options \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/companies/fields/{fieldId}/dropdown-options"
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/fields/{fieldId}/dropdown-options', 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/fields/{fieldId}/dropdown-options",
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/fields/{fieldId}/dropdown-options"
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/fields/{fieldId}/dropdown-options")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/companies/fields/{fieldId}/dropdown-options")
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": [
{
"type": "dropdown",
"id": 1,
"text": "Seed"
},
{
"type": "dropdown",
"id": 2,
"text": "Series A"
},
{
"type": "dropdown",
"id": 3,
"text": "Series B"
}
],
"pagination": {
"prevUrl": null,
"nextUrl": null
}
}Authorizations
A static Affinity API key, presented as a bearer token.
Path Parameters
Field ID
Example:
"field-1234"
Query Parameters
Cursor for the next or previous page
Example:
"ICAgICAgYmVmb3JlOjo6Nw"
Number of items to include in the page
Required range:
1 <= x <= 100Response
OK
DropdownOptionPaged model
data
(dropdownOptions.DropdownOption · object | dropdownOptions.RankedDropdownOption · object | dropdownOptions.StatusDropdownOption · object)[]
required
A page of DropdownOption results
Maximum array length:
100- dropdownOptions.DropdownOption
- dropdownOptions.RankedDropdownOption
- dropdownOptions.StatusDropdownOption
Show child attributes
Show child attributes
Example:
{
"type": "dropdown",
"id": 1,
"text": "Seed"
}
Show child attributes
Show child attributes
Was this page helpful?