curl --request POST \
--url https://{subdomain}.domo.com/api/ai/v1/targeted-sentiment \
--header 'Content-Type: application/json' \
--header 'X-DOMO-Developer-Token: <api-key>' \
--data '
{
"input": [
{
"type": "TEXT",
"text": "The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get."
}
],
"topics": [
{
"topic": "product_quality",
"description": "Quality and features of the product"
},
{
"topic": "shipping",
"description": "Shipping speed and delivery experience"
},
{
"topic": "customer_service",
"description": "Customer support experience"
},
{
"topic": "pricing",
"description": "Price and value for money"
}
]
}
'import requests
url = "https://{subdomain}.domo.com/api/ai/v1/targeted-sentiment"
payload = {
"input": [
{
"type": "TEXT",
"text": "The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get."
}
],
"topics": [
{
"topic": "product_quality",
"description": "Quality and features of the product"
},
{
"topic": "shipping",
"description": "Shipping speed and delivery experience"
},
{
"topic": "customer_service",
"description": "Customer support experience"
},
{
"topic": "pricing",
"description": "Price and value for money"
}
]
}
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: 'The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get.'
}
],
topics: [
{topic: 'product_quality', description: 'Quality and features of the product'},
{topic: 'shipping', description: 'Shipping speed and delivery experience'},
{topic: 'customer_service', description: 'Customer support experience'},
{topic: 'pricing', description: 'Price and value for money'}
]
})
};
fetch('https://{subdomain}.domo.com/api/ai/v1/targeted-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/targeted-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' => 'The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get.'
]
],
'topics' => [
[
'topic' => 'product_quality',
'description' => 'Quality and features of the product'
],
[
'topic' => 'shipping',
'description' => 'Shipping speed and delivery experience'
],
[
'topic' => 'customer_service',
'description' => 'Customer support experience'
],
[
'topic' => 'pricing',
'description' => 'Price and value for money'
]
]
]),
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/targeted-sentiment"
payload := strings.NewReader("{\n \"input\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get.\"\n }\n ],\n \"topics\": [\n {\n \"topic\": \"product_quality\",\n \"description\": \"Quality and features of the product\"\n },\n {\n \"topic\": \"shipping\",\n \"description\": \"Shipping speed and delivery experience\"\n },\n {\n \"topic\": \"customer_service\",\n \"description\": \"Customer support experience\"\n },\n {\n \"topic\": \"pricing\",\n \"description\": \"Price and value for money\"\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/targeted-sentiment")
.header("X-DOMO-Developer-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get.\"\n }\n ],\n \"topics\": [\n {\n \"topic\": \"product_quality\",\n \"description\": \"Quality and features of the product\"\n },\n {\n \"topic\": \"shipping\",\n \"description\": \"Shipping speed and delivery experience\"\n },\n {\n \"topic\": \"customer_service\",\n \"description\": \"Customer support experience\"\n },\n {\n \"topic\": \"pricing\",\n \"description\": \"Price and value for money\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.domo.com/api/ai/v1/targeted-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\": \"The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get.\"\n }\n ],\n \"topics\": [\n {\n \"topic\": \"product_quality\",\n \"description\": \"Quality and features of the product\"\n },\n {\n \"topic\": \"shipping\",\n \"description\": \"Shipping speed and delivery experience\"\n },\n {\n \"topic\": \"customer_service\",\n \"description\": \"Customer support experience\"\n },\n {\n \"topic\": \"pricing\",\n \"description\": \"Price and value for money\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "TARGETED",
"topicSentiments": {
"shipping": "negative",
"product_quality": "positive",
"customer_service": "negative",
"pricing": "positive"
},
"model": "domo.domo_ai.domogpt-medium-v2.1:anthropic",
"isCustomerModel": false,
"sessionId": "34c1b391-1302-4149-89ad-dd5c9a009e89",
"requestId": "d81674e9-984d-4ca3-b943-acf1fdbc95b4",
"modelProviderUsage": null
}"<string>"Targeted Sentiment Analysis - Beta
Analyze sentiment for specific topics.
curl --request POST \
--url https://{subdomain}.domo.com/api/ai/v1/targeted-sentiment \
--header 'Content-Type: application/json' \
--header 'X-DOMO-Developer-Token: <api-key>' \
--data '
{
"input": [
{
"type": "TEXT",
"text": "The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get."
}
],
"topics": [
{
"topic": "product_quality",
"description": "Quality and features of the product"
},
{
"topic": "shipping",
"description": "Shipping speed and delivery experience"
},
{
"topic": "customer_service",
"description": "Customer support experience"
},
{
"topic": "pricing",
"description": "Price and value for money"
}
]
}
'import requests
url = "https://{subdomain}.domo.com/api/ai/v1/targeted-sentiment"
payload = {
"input": [
{
"type": "TEXT",
"text": "The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get."
}
],
"topics": [
{
"topic": "product_quality",
"description": "Quality and features of the product"
},
{
"topic": "shipping",
"description": "Shipping speed and delivery experience"
},
{
"topic": "customer_service",
"description": "Customer support experience"
},
{
"topic": "pricing",
"description": "Price and value for money"
}
]
}
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: 'The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get.'
}
],
topics: [
{topic: 'product_quality', description: 'Quality and features of the product'},
{topic: 'shipping', description: 'Shipping speed and delivery experience'},
{topic: 'customer_service', description: 'Customer support experience'},
{topic: 'pricing', description: 'Price and value for money'}
]
})
};
fetch('https://{subdomain}.domo.com/api/ai/v1/targeted-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/targeted-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' => 'The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get.'
]
],
'topics' => [
[
'topic' => 'product_quality',
'description' => 'Quality and features of the product'
],
[
'topic' => 'shipping',
'description' => 'Shipping speed and delivery experience'
],
[
'topic' => 'customer_service',
'description' => 'Customer support experience'
],
[
'topic' => 'pricing',
'description' => 'Price and value for money'
]
]
]),
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/targeted-sentiment"
payload := strings.NewReader("{\n \"input\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get.\"\n }\n ],\n \"topics\": [\n {\n \"topic\": \"product_quality\",\n \"description\": \"Quality and features of the product\"\n },\n {\n \"topic\": \"shipping\",\n \"description\": \"Shipping speed and delivery experience\"\n },\n {\n \"topic\": \"customer_service\",\n \"description\": \"Customer support experience\"\n },\n {\n \"topic\": \"pricing\",\n \"description\": \"Price and value for money\"\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/targeted-sentiment")
.header("X-DOMO-Developer-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get.\"\n }\n ],\n \"topics\": [\n {\n \"topic\": \"product_quality\",\n \"description\": \"Quality and features of the product\"\n },\n {\n \"topic\": \"shipping\",\n \"description\": \"Shipping speed and delivery experience\"\n },\n {\n \"topic\": \"customer_service\",\n \"description\": \"Customer support experience\"\n },\n {\n \"topic\": \"pricing\",\n \"description\": \"Price and value for money\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.domo.com/api/ai/v1/targeted-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\": \"The product quality is excellent and works perfectly. However, the shipping took longer than expected and customer service was slow to respond. Pricing is fair for what you get.\"\n }\n ],\n \"topics\": [\n {\n \"topic\": \"product_quality\",\n \"description\": \"Quality and features of the product\"\n },\n {\n \"topic\": \"shipping\",\n \"description\": \"Shipping speed and delivery experience\"\n },\n {\n \"topic\": \"customer_service\",\n \"description\": \"Customer support experience\"\n },\n {\n \"topic\": \"pricing\",\n \"description\": \"Price and value for money\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "TARGETED",
"topicSentiments": {
"shipping": "negative",
"product_quality": "positive",
"customer_service": "negative",
"pricing": "positive"
},
"model": "domo.domo_ai.domogpt-medium-v2.1:anthropic",
"isCustomerModel": false,
"sessionId": "34c1b391-1302-4149-89ad-dd5c9a009e89",
"requestId": "d81674e9-984d-4ca3-b943-acf1fdbc95b4",
"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 targeted sentiment analysis response.
Response for targeted sentiment analysis containing sentiment per topic.
Map of topic to sentiment (includes NOT_APPLICABLE for unmentioned topics)
Show child attributes
Show child attributes
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