curl --request POST \
--url https://{subdomain}.domo.com/api/ai/v1/sentiment \
--header 'Content-Type: application/json' \
--header 'X-DOMO-Developer-Token: <api-key>' \
--data @- <<EOF
{
"input": [
{
"type": "TEXT",
"text": "This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I'm very happy with my purchase."
}
]
}
EOFimport requests
url = "https://{subdomain}.domo.com/api/ai/v1/sentiment"
payload = { "input": [
{
"type": "TEXT",
"text": "This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I'm very happy with my purchase."
}
] }
headers = {
"X-DOMO-Developer-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-DOMO-Developer-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: [
{
type: 'TEXT',
text: 'This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I\'m very happy with my purchase.'
}
]
})
};
fetch('https://{subdomain}.domo.com/api/ai/v1/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://{subdomain}.domo.com/api/ai/v1/sentiment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
[
'type' => 'TEXT',
'text' => 'This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I\'m very happy with my purchase.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-DOMO-Developer-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.domo.com/api/ai/v1/sentiment"
payload := strings.NewReader("{\n \"input\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I'm very happy with my purchase.\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-DOMO-Developer-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{subdomain}.domo.com/api/ai/v1/sentiment")
.header("X-DOMO-Developer-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I'm very happy with my purchase.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.domo.com/api/ai/v1/sentiment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-DOMO-Developer-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I'm very happy with my purchase.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "DEFAULT",
"sentiment": "positive",
"model": "domo.domo_ai.domogpt-medium-v2.1:anthropic",
"isCustomerModel": false,
"sessionId": "34c1b391-1302-4149-89ad-dd5c9a009e89",
"requestId": "5e2d7a6b-af27-4cf2-9fe8-70cfb90d72c2",
"modelProviderUsage": null
}"<string>"Sentiment Analysis - Beta
Analyze the overall sentiment of text (positive, negative, neutral, or not applicable).
curl --request POST \
--url https://{subdomain}.domo.com/api/ai/v1/sentiment \
--header 'Content-Type: application/json' \
--header 'X-DOMO-Developer-Token: <api-key>' \
--data @- <<EOF
{
"input": [
{
"type": "TEXT",
"text": "This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I'm very happy with my purchase."
}
]
}
EOFimport requests
url = "https://{subdomain}.domo.com/api/ai/v1/sentiment"
payload = { "input": [
{
"type": "TEXT",
"text": "This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I'm very happy with my purchase."
}
] }
headers = {
"X-DOMO-Developer-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-DOMO-Developer-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: [
{
type: 'TEXT',
text: 'This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I\'m very happy with my purchase.'
}
]
})
};
fetch('https://{subdomain}.domo.com/api/ai/v1/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://{subdomain}.domo.com/api/ai/v1/sentiment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
[
'type' => 'TEXT',
'text' => 'This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I\'m very happy with my purchase.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-DOMO-Developer-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.domo.com/api/ai/v1/sentiment"
payload := strings.NewReader("{\n \"input\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I'm very happy with my purchase.\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-DOMO-Developer-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{subdomain}.domo.com/api/ai/v1/sentiment")
.header("X-DOMO-Developer-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I'm very happy with my purchase.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.domo.com/api/ai/v1/sentiment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-DOMO-Developer-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"This product is absolutely amazing! The quality exceeded my expectations and the customer service was outstanding. I'm very happy with my purchase.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "DEFAULT",
"sentiment": "positive",
"model": "domo.domo_ai.domogpt-medium-v2.1:anthropic",
"isCustomerModel": false,
"sessionId": "34c1b391-1302-4149-89ad-dd5c9a009e89",
"requestId": "5e2d7a6b-af27-4cf2-9fe8-70cfb90d72c2",
"modelProviderUsage": null
}"<string>"Authorizations
Body
Request for sentiment analysis using the Messages API.
Supports two modes:
- Simple sentiment: When topics is null/empty, analyzes overall sentiment
- Targeted sentiment: When topics provided, analyzes sentiment for each topic
Validation happens primarily in AIValidator, not in this constructor.
The input message content to analyze (text, images, documents, etc.)
Text-based message content.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Optional list of topics for targeted sentiment analysis. When provided, sentiment is analyzed for each topic individually. When omitted or empty, overall sentiment of the content is analyzed. Topic names must start with a letter and contain only letters, numbers, and underscores (e.g., 'customer_service', 'productQuality').
Show child attributes
Show child attributes
Optional instructions for sentiment analysis behavior
The ID of the model to use (optional, uses default if not specified)
Additional model parameters (temperature, max_tokens, etc.)
Show child attributes
Show child attributes
AI session ID for associating with existing session
Configuration for reasoning behavior
Show child attributes
Show child attributes
Returns true if this is a targeted sentiment request (has topics).
Returns true if this is a simple sentiment request (no topics).
Response
Successful sentiment analysis response.
Response for simple sentiment analysis containing overall sentiment.
The overall sentiment (POSITIVE, NEGATIVE, NEUTRAL, or NOT_APPLICABLE)
positive, negative, neutral, not_applicable The ID of the model used
Whether the model is a customer model
The AI session ID
The request ID
Token usage information
Show child attributes
Show child attributes