1. Home
  2. Docs
  3. Virtual Assistants
  4. API Guide
  5. Query Data (Table) API

Query Data (Table) API

  Used to get data from Data Table.

Method POST
Endpoint https://{{host}}/api/public/tables/{{tableName}}/query?sys_limit={{limit_value}}&sys_offset={{offset_value}}
Content Type application/json
Authorization

auth: {{JWT}}

See How to generate the JWT Token.

App Access

Read access to the Data Table from the Data Definition in DaaS.

For more information, see app assignment for accessing the data in a table and Data as a Service articles.

 

Path Parameters

Parameter Description
host Environment URL, for example, https://bots.kore.ai
tableName Name of the Table to fetch data
sys_limit The maximum number of records to be fetched.
By default this is set to 10 and the maximum allowed is 100.
sys_offset The number of records to be skipped from the beginning of the results dataset.

 

Sample Request

curl -X POST \
  'https://{{host}}/api/public/tables/{{tableName}}/query?sys_limit=4&sys_offset=0' \
  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
  -H 'content-type: application/json' \
  -d '{
      "query":{
 	"expressions": [
        	{"field": "firstName", "operand": "=", "value": "Jane"},
		{"field": "lastName", "operand": "=", "value": "Doe"}
		],
		"operator": "or"
	   }
}'

 

Body Parameters

Parameter Description
query

Filter criteria identifying the rows to be fetched

 "query":{
	"expressions": [
	   {"field": "<col1_name>", "operand": "=/!=/</>", "value": "<value1>"},
	   {"field": "<col2_name>", "operand": "=/!=/</>", "value": "<value2>"}
	],
	"operator": "and/or"
	   }

 

Sample Response

{
    "hasMore": true,
    "total": 2,
      "metaInfo": [
        {
            "name": "gender",
            "type": "string"
        },
        {
            "name": "lastName",
            "type": "string"
        }
    ],
    "queryResult": [
        {
            "age": male,
            "last_name":tony,
        }
    ]
}

 

Menu