curl --request GET \
--url https://core-api.getaptly.com/api/contacts/{contactId}/sentiment \
--header 'x-token: <api-key>'import requests
url = "https://core-api.getaptly.com/api/contacts/{contactId}/sentiment"
headers = {"x-token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-token': '<api-key>'}};
fetch('https://core-api.getaptly.com/api/contacts/{contactId}/sentiment', 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://core-api.getaptly.com/api/contacts/{contactId}/sentiment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-token: <api-key>"
],
]);
$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://core-api.getaptly.com/api/contacts/{contactId}/sentiment"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://core-api.getaptly.com/api/contacts/{contactId}/sentiment")
.header("x-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api.getaptly.com/api/contacts/{contactId}/sentiment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"overall": 76,
"totalStreams": 2,
"history": [
{
"date": "2026-08-15T00:00:00.000Z",
"score": 40,
"streams": 2
},
{
"date": "2026-09-04T00:00:00.000Z",
"score": 100,
"streams": 1
}
]
}{
"error": "<string>",
"message": "<string>"
}Get a contact's sentiment history
Returns the contact’s conversation sentiment over the last 30 days, merged into a
single series across every channel in the company and keyed off the addresses in the
contact’s email array.
One point per day, oldest first. score is the average of the day’s streams — each
stream contributes one score, so a long conversation does not outweigh a short one —
rounded to a whole number on a 0-100 scale. overall is the recency-weighted average
across the window: today counts fully, a day at the edge of the window counts half.
totalStreams counts the distinct conversations in the window, so a conversation
spanning several days is counted once.
A contact with no email addresses, or with no scored conversations in the window,
returns overall: null and an empty history.
curl --request GET \
--url https://core-api.getaptly.com/api/contacts/{contactId}/sentiment \
--header 'x-token: <api-key>'import requests
url = "https://core-api.getaptly.com/api/contacts/{contactId}/sentiment"
headers = {"x-token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-token': '<api-key>'}};
fetch('https://core-api.getaptly.com/api/contacts/{contactId}/sentiment', 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://core-api.getaptly.com/api/contacts/{contactId}/sentiment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-token: <api-key>"
],
]);
$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://core-api.getaptly.com/api/contacts/{contactId}/sentiment"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://core-api.getaptly.com/api/contacts/{contactId}/sentiment")
.header("x-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api.getaptly.com/api/contacts/{contactId}/sentiment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"overall": 76,
"totalStreams": 2,
"history": [
{
"date": "2026-08-15T00:00:00.000Z",
"score": 40,
"streams": 2
},
{
"date": "2026-09-04T00:00:00.000Z",
"score": 100,
"streams": 1
}
]
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Path Parameters
The contact's _id.