Ask Attention
curl --request POST \
--url https://api.attention.tech/v2/ask_attention \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"context_type": "conversation",
"context_id": "conv_123",
"prompt": "Customer mentioned budget constraints but showed interest in premium features"
}
'import requests
url = "https://api.attention.tech/v2/ask_attention"
payload = {
"context_type": "conversation",
"context_id": "conv_123",
"prompt": "Customer mentioned budget constraints but showed interest in premium features"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
context_type: 'conversation',
context_id: 'conv_123',
prompt: 'Customer mentioned budget constraints but showed interest in premium features'
})
};
fetch('https://api.attention.tech/v2/ask_attention', 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.attention.tech/v2/ask_attention",
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([
'context_type' => 'conversation',
'context_id' => 'conv_123',
'prompt' => 'Customer mentioned budget constraints but showed interest in premium features'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://api.attention.tech/v2/ask_attention"
payload := strings.NewReader("{\n \"context_type\": \"conversation\",\n \"context_id\": \"conv_123\",\n \"prompt\": \"Customer mentioned budget constraints but showed interest in premium features\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.attention.tech/v2/ask_attention")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"context_type\": \"conversation\",\n \"context_id\": \"conv_123\",\n \"prompt\": \"Customer mentioned budget constraints but showed interest in premium features\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attention.tech/v2/ask_attention")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"context_type\": \"conversation\",\n \"context_id\": \"conv_123\",\n \"prompt\": \"Customer mentioned budget constraints but showed interest in premium features\"\n}"
response = http.request(request)
puts response.read_body{
"output": "Yes, this is an example of an 'Ask Attention' response",
"conversations_used": [
"conv_uuid_1",
"conv_uuid_2"
]
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}Tool
Ask Attention
deprecated
Analyzes conversations or prompts to provide insights and attention points. This endpoint helps identify key information, sentiment, and important details in the provided content.
POST
/
ask_attention
Ask Attention
curl --request POST \
--url https://api.attention.tech/v2/ask_attention \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"context_type": "conversation",
"context_id": "conv_123",
"prompt": "Customer mentioned budget constraints but showed interest in premium features"
}
'import requests
url = "https://api.attention.tech/v2/ask_attention"
payload = {
"context_type": "conversation",
"context_id": "conv_123",
"prompt": "Customer mentioned budget constraints but showed interest in premium features"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
context_type: 'conversation',
context_id: 'conv_123',
prompt: 'Customer mentioned budget constraints but showed interest in premium features'
})
};
fetch('https://api.attention.tech/v2/ask_attention', 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.attention.tech/v2/ask_attention",
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([
'context_type' => 'conversation',
'context_id' => 'conv_123',
'prompt' => 'Customer mentioned budget constraints but showed interest in premium features'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://api.attention.tech/v2/ask_attention"
payload := strings.NewReader("{\n \"context_type\": \"conversation\",\n \"context_id\": \"conv_123\",\n \"prompt\": \"Customer mentioned budget constraints but showed interest in premium features\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.attention.tech/v2/ask_attention")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"context_type\": \"conversation\",\n \"context_id\": \"conv_123\",\n \"prompt\": \"Customer mentioned budget constraints but showed interest in premium features\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attention.tech/v2/ask_attention")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"context_type\": \"conversation\",\n \"context_id\": \"conv_123\",\n \"prompt\": \"Customer mentioned budget constraints but showed interest in premium features\"\n}"
response = http.request(request)
puts response.read_body{
"output": "Yes, this is an example of an 'Ask Attention' response",
"conversations_used": [
"conv_uuid_1",
"conv_uuid_2"
]
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}Authorizations
Body
application/jsonapplication/vnd.api+json
Request containing the content to be analyzed and analysis parameters
Was this page helpful?
⌘I