Retrieve asynchronous query results
Public beta
Conversation Insights, including the APIs, is currently available as a public beta release and the information contained in this document is subject to change. Some features are not yet implemented and others may be changed before the product is declared as generally available. Public beta products are not covered by the Twilio Support Terms or Twilio Service Level Agreement.
Conversation Insights is not PCI compliant or a HIPAA Eligible Service and should not be used in workflows that are subject to HIPAA or PCI.
Conversations products are only available in the new Twilio Console. If your account hasn't been migrated, you'll be redirected to the legacy Console where these products won't appear.
GET/v3/InsightsDomains/Conversations/QueryJobs/{operationId}/Results
Base url: https://insights.twilio.com (base url)
Retrieve paginated results for a completed asynchronous query operation. The resultUrl in the status response points to this endpoint. Returns 404 if the operation is not yet COMPLETED or has expired.
The unique identifier for the asynchronous query operation, in TTID format.
proc_job_01h9d8r0vte3hz8tykdj329t7rThe maximum number of resources to return
50Minimum: 1Maximum: 1000Token for pagination
Query results
Indicates the business domain the query was executed against
InsightsArray of result objects containing the query results. Each object contains properties matching the requested measures and dimensions.
[{"Id":"conv1","Languages":["en"],"Channels":["voice"],"OperatorResult.Value":"positive"},{"Id":"conv2","Languages":["en","es"],"Channels":["chat"],"OperatorResult.Value":"negative"}]The pagination metadata containing navigation tokens and result information. By convention, this schema should be added to the response payload's 'meta' attribute.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchQueryJobResults() {11const result = await client.insights.v3.results("operationId").fetch();1213console.log(result.domain);14}1516fetchQueryJobResults();
Response
1{2"domain": "Conversations",3"items": [4{5"Id": "conv1",6"Languages": [7"en"8],9"Channels": [10"voice"11],12"OperatorResult.Value": "positive"13},14{15"Id": "conv2",16"Languages": [17"en",18"es"19],20"Channels": [21"chat"22],23"OperatorResult.Value": "negative"24}25],26"meta": {27"key": "items",28"pageSize": 2,29"nextToken": "eyJwYWdlIjoyLCJxdWVyeSI6ImJvb2tzIn0="30}31}