クエリデータ(ビュー)API

Used to get data from Table View.

To use this API, the app needs to be given Read access to the Table View from the Data Definition in DaaS (see here for details)

POST https://{{host}}/api/public/views/{{viewName}}/query?sys_limit={{limit_value}}&sys_offset={{offset_value}}

Kore.ai Bots Platform provides access to bot development using secured APIs. Refer here to learn more on how to use these APIs.

Query Parameters

Parameter Description
host Environment URL, for example, https://bots.kore.ai
viewName The table view form which to fetch data.
sys_limit The maximum number of records to be fetched.
sys_offset The number of records to be skipped from the beginning of the results dataset.

本文パラメータ

パラメータ 説明
クエリ 取得される行を特定するフィルタの基準

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

認証

以下の構文を使用して、JWTをヘッダーに含むAPIを呼び出します。 auth: {{JWT}}

応答のコンテンツタイプ

application/json

サンプルリクエスト

curl -X POST \ http://{{host}}/api/public/views/{{viewName}}/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" } }'

サンプル応答

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

Query Data (View) API

Used to get data from Table View.

To use this API, the app needs to be given Read access to the Table View from the Data Definition in DaaS (see here for details)

POST https://{{host}}/api/public/views/{{viewName}}/query?sys_limit={{limit_value}}&sys_offset={{offset_value}}

Kore.ai Bots Platform provides access to bot development using secured APIs. Refer here to learn more on how to use these APIs.

Query Parameters

Parameter Description
host Environment URL, for example, https://bots.kore.ai
viewName The table view form which to fetch data.
sys_limit The maximum number of records to be fetched.
sys_offset The number of records to be skipped from the beginning of the results dataset.

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"
	   }

Authorization

Invoke the API with JWT in the header with the following syntax:

auth: {{JWT}}

Response content type

application/json

Sample Request

curl -X POST \
  http://{{host}}/api/public/views/{{viewName}}/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"
	   }
}'

Sample Response

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