Make an Ask
Use natural language to query your data
Body
application/jsonquestion string
required
A question in natural language that you want to ask the system.
conversationId string
required
A unique identifier for the conversation.
requestContext string
required
A JSON object containing the user and organization identifiers.
Response
200 - application/jsonanswer object
required
Child Attributes
answer.type enum<string>
required
The type of response.
One of: text
, chart
, table
.
answer.message string
required
A message to display to the user.
answer.chart object
Child Attributes
answer.chart.type enum<string>
One of: line
, bar
answer.chart.title string
The title of the chart.
answer.chart.xLabel string
The label for the x-axis.
answer.chart.yLabel string
The label for the y-axis.
answer.chart.data object[]
An array of objects containing the data points for the chart.
Child Attributes
answer.chart.data.label string
The label for the data point.
answer.chart.data.value string
The value for the data point.
answer.table object
Child Attributes
answer.table.head object[]
Child Attributes
answer.table.head.name string
The name of the header.
answer.table.head.type string
The type of the header.
answer.table.body [][]
Each row is an array whose values correspond to the column names at their index. The value index of the array can be a string or number.
curl --request POST \ --url "https://api.inconvo.com/ask" \ --header "Content-Type: application/json" \ --data '{ "question": "How many products have we sold over the past 6 months?", "conversationId": "conv_c9b1d", "requestContext": { "userId": "user_d7adc", "orgId": "org_99548" } }'
{ "type": "text", "message": "You have sold 293 product over the past 6 months."}
curl --request POST \ --url "https://api.inconvo.com/ask" \ --header "Content-Type: application/json" \ --data '{ "question": "How many products have I sold per day of the week?", "conversationId": "conv_c9b1d", "requestContext": { "userId": "user_d7adc", "orgId": "org_99548" } }'
{ "type": "chart", "message": "Here's a breakdown of the number of products sold per day of the week.", "chart": { "type": "bar", "title": "Movies Rented Per Day of the Week", "xLabel": "Day of the Week", "yLabel": "Number of Movies Rented", "data": [ { "label": "Monday", "value": 8 }, { "label": "Tuesday", "value": 8 }, { "label": "Wednesday", "value": 10 }, { "label": "Thursday", "value": 12 }, { "label": "Friday", "value": 10 }, { "label": "Saturday", "value": 10 }, { "label": "Sunday", "value": 6 } ] }}
curl --request POST \ --url "https://api.inconvo.com/ask" \ --header "Content-Type: application/json" \ --data '{ "question": "What were my top 5 selling products last quarter?", "conversationId": "conv_c9b1d", "requestContext": { "userId": "user_d7adc", "orgId": "org_99548" } }'
{ "type": "table", "message": "Here's a breakdown of the product sales data.", "table": { "head": [ "Product Name", "#Sold", "Revenue", "Profit" ], "body": [ ["Mac Mini", 300, "$3000", "$600"], ["Nvidia Digits", 250, "$2500", "$500"], ["Mac Studio", 200, "$2000", "$400"], ["Raspberry Pi 4", 150, "$1500", "$300"], ["Vector One", 100, "$1000", "$200"] ] }}