curl --request GET \
--url https://api.affinity.co/v2/opportunities/{opportunityId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/opportunities/{opportunityId}"
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/opportunities/{opportunityId}', 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/opportunities/{opportunityId}",
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/opportunities/{opportunityId}"
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/opportunities/{opportunityId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/opportunities/{opportunityId}")
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,
"name": "Horizon Technologies Upsell $10k",
"listId": 1,
"listName": "Pipeline Q1 2024",
"isRestricted": false,
"isRedacted": false
}{
"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 Opportunity
Returns basic information but not field data on the requested Opportunity.
To access field data on Opportunities, use the /lists/{list_id}/list-entries
or the /v2/lists/{list_id}/saved-views/{view_id}/list-entries GET endpoint.
curl --request GET \
--url https://api.affinity.co/v2/opportunities/{opportunityId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.affinity.co/v2/opportunities/{opportunityId}"
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/opportunities/{opportunityId}', 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/opportunities/{opportunityId}",
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/opportunities/{opportunityId}"
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/opportunities/{opportunityId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/opportunities/{opportunityId}")
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,
"name": "Horizon Technologies Upsell $10k",
"listId": 1,
"listName": "Pipeline Q1 2024",
"isRestricted": false,
"isRedacted": false
}{
"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
Opportunity ID
1 <= x <= 9007199254740991Response
OK
Opportunity model.
The unique identifier for the opportunity
1 <= x <= 90071992547409911
The name of the opportunity. When isRedacted is true, the real name
is masked and this value is the literal string [Hidden].
"Horizon Technologies Upsell $10k"
The ID of the list that the opportunity belongs to
1 <= x <= 90071992547409911
The name of the list that the opportunity belongs to
"Pipeline Q1 2024"
Whether the opportunity is restricted. false for customers without
the Restricted Opportunities feature enabled.
false
Whether the response is redacted because the requesting user does not
have access to this restricted opportunity. The real name is masked as
[Hidden] when true. Always false when isRestricted is false.
false
Was this page helpful?