Get conversation analytics
curl --request GET \
--url https://api.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId}', 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.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId}",
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.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId}"
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.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId}")
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{
"bySource": [
{
"count": 123,
"source": "<string>"
}
],
"conversationId": "<string>",
"from": "2023-12-25",
"platform": "<string>",
"success": true,
"summary": {
"failed": 123,
"firstMessageAt": "2023-11-07T05:31:56Z",
"lastMessageAt": "2023-11-07T05:31:56Z",
"read": 123,
"received": 123,
"sent": 123,
"totalMessages": 123
},
"timeseries": [
{
"date": "2023-12-25",
"failed": 123,
"read": 123,
"received": 123,
"sent": 123
}
],
"to": "2023-12-25"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "never",
"retryable": true,
"type": "<string>"
}
}数据分析
Get conversation analytics
Inbox Analytics. Read only; needs social:read. Ids are yours: accounts acc_…, profiles prf_…, posts pst_…; every other object id is checked against your accounts before the call.
Per-conversation inbox analytics. The inbox analog of /apis/v1/social/analytics/post-timeline: one conversation, daily totals, source mix.
The path param accepts EITHER the AIsa
conversation id OR its platformConversationId (the same
identity used by metadata.conversationId at ingest time).
Ownership is verified against the caller’s team before the
the analytics store query fires.
Max date range is 365 days.
GET
https://api.aisa.one
/
apis
/
v1
/
social
/
analytics
/
inbox
/
conversations
/
{conversationId}
Get conversation analytics
curl --request GET \
--url https://api.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId}', 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.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId}",
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.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId}"
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.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId}")
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{
"bySource": [
{
"count": 123,
"source": "<string>"
}
],
"conversationId": "<string>",
"from": "2023-12-25",
"platform": "<string>",
"success": true,
"summary": {
"failed": 123,
"firstMessageAt": "2023-11-07T05:31:56Z",
"lastMessageAt": "2023-11-07T05:31:56Z",
"read": 123,
"received": 123,
"sent": 123,
"totalMessages": 123
},
"timeseries": [
{
"date": "2023-12-25",
"failed": 123,
"read": 123,
"received": 123,
"sent": 123
}
],
"to": "2023-12-25"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "never",
"retryable": true,
"type": "<string>"
}
}请求规范
- 方法与路径: GET /apis/v1/social/analytics/inbox/conversations/{conversationId}
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/social/analytics/inbox/conversations/{conversationId} - conversationId: path; 必填
- fromDate: query; 必填
- toDate: query; 可选
- accountId: query; 必填
{
"operationId": "get_aisa_social_apis_v1_social_analytics_inbox_co_f87ada",
"method": "GET",
"path": "/apis/v1/social/analytics/inbox/conversations/{conversationId}",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "AIsa conversation id or platformConversationId.",
"in": "path",
"name": "conversationId",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "fromDate",
"required": true,
"schema": {
"format": "date",
"type": "string"
}
},
{
"in": "query",
"name": "toDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
},
{
"description": "The social account (acc_...) the conversation belongs to. Required by AIsa for the ownership check; not forwarded.",
"in": "query",
"name": "accountId",
"required": true,
"schema": {
"pattern": "^acc_[0-9A-Za-z]{22}$",
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}