Get Question Classification Results
Retrieve the saved categories and sentiment for user questions in either standard or advanced recognition mode.
Request Method
GET
Request URL
https://api-sg.gptbots.ai/v1/question-category-results
Authentication
Use the API key for the Agent. The project plan must include API integration and issue recognition. Use the endpoint for your organization's data center. API Overview
Request Frequency
Requests share the project's per-minute Analytics API quota. Exceeding it returns 40008.
Request
Request Example
curl -X GET "https://api-sg.gptbots.ai/v1/question-category-results?message_id=66b2c3d4e5f6000100000010&page_size=5" \
-H "Authorization: Bearer your_apikey"
curl -X GET "https://api-sg.gptbots.ai/v1/question-category-results?conversation_id=66b2c3d4e5f6000100000001&page=1&page_size=20" \
-H "Authorization: Bearer your_apikey"
curl -X GET "https://api-sg.gptbots.ai/v1/question-category-results?start_time=1763913600000&end_time=1764000000000&page=1&page_size=20" \
-H "Authorization: Bearer your_apikey"
Request Headers
| Field | Type | Description |
|---|---|---|
| Authorization | string | Bearer your_apikey |
Request Parameters
Choose one filter: question message ID, conversation ID, or a start and end time. The time range includes both endpoints and may span up to 31 days. Only questions within the plan's log retention period are visible.
For a message lookup, page must be 1. At most one item is returned; page_size is still validated and echoed. An answer ID or a question outside the visible scope returns total 0 and an empty items array.
| Field | Type | Required | Description |
|---|---|---|---|
| message_id | string | One filter | Question message ID |
| conversation_id | string | One filter | Conversation ID |
| start_time | long | One filter | Start time in Unix milliseconds |
| end_time | long | One filter | End time in Unix milliseconds |
| page | int | No | Page number, starting at 1. Default 1. |
| page_size | int | No | Page size from 1 to 100. Default 20. |
Response
Response Example
{
"total": 1,
"page": 1,
"page_size": 5,
"items": [
{
"message_id": "66b2c3d4e5f6000100000010",
"conversation_id": "66b2c3d4e5f6000100000001",
"question_time": 1764000000000,
"categories": [
{
"id": "66a1b2c3d4e5f60001000002",
"name": "Refund status",
"parent_id": "66a1b2c3d4e5f60001000001"
}
],
"sentiment": "negative"
}
]
}
Successful Response
| Field | Type | Description |
|---|---|---|
| total | long | Total visible questions matching the filter |
| page | int | Page number, starting at 1. Default 1. |
| page_size | int | Page size from 1 to 100. Default 20. |
| items | array | Records on this page |
| message_id | string | Question message ID |
| conversation_id | string | Conversation ID |
| question_time | long | Question creation time in Unix milliseconds |
| categories | array | Matched child categories |
| id | string | Category ID |
| name | string | Current category name, including disabled categories. |
| parent_id | string | Parent ID; null at the top level. |
| sentiment | string | User sentiment (none, very_negative, negative, neutral, positive, very_positive). |
Conversation and time queries sort by question time and then message ID, both descending. Questions without a match remain in the result with an empty categories array.
Historical results show current names. Deleting a category removes its match from historical results. Set enabled to false to preserve those matches.
Empty message lookup with page_size=5
{
"total": 0,
"page": 1,
"page_size": 5,
"items": []
}
Failed Response
| Field | Type | Description |
|---|---|---|
| code | int | Error code. |
| message | string | Error description information. |
Error Codes
| Code | Message |
|---|---|
| 40000 | Invalid parameters |
| 40008 | Analytics API rate limit exceeded |
| 40100 | The Agent does not have access to the resource |
| 40101 | Missing Authorization header |
| 40127 | Invalid Agent API key |
| 20055 | API access is disabled for the Agent |
| 40353 | Plan lacks required features |
| 50000 | Internal server error |
