データ更新API

Used to update data into Data Table.

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

PUT https://{{host}}/api/public/tables/{{tableName}}

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
tableName Name of the table to update data

本文パラメータ

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

 "query":{ "expressions": [ {"field": "<col1_name>", "operand": "=/!=/</>", "value": "<value1>"}, {"field": "<col2_name>", "operand": "=/!=/</>", "value": "<value2>"} ], "operator": "and/or" }
日付 更新される列のcolumn_name: value pairingを含むオブジェクト

"data": { "<col1_name>": "<value1>", "<col2_name>": "<value2>", }

認証

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

応答のコンテンツタイプ

application/json

サンプルリクエスト

curl -X PUT \ http://{{host}}/api/public/tables/{{tableName}} \ -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": "and" }, "data": { "First_Name": "Jane", "Last_Name": "Smith", "Number": 3453 } }'

サンプル応答

{ "records": [ { "_id": "5e7ef67172034b399ace6b03", "First_Name": "Jane", "Last_Name": "Smith", "Gender": "Female", "Number": 3453, "Updated_On": "2020-03-28T07:51:32.502Z", "Created_On": "2019-03-28T07:02:09.652Z", "Updated_By": "st-98e05480-0257-5e35-b6d2-66a323834f9d", "Created_By": "st-98e05480-0257-5e35-b6d2-66a323834f9d", "sys_Id": "sys-545dae21-8675-5a95-9c1b-a223bc6f4bc8" } ] }

Data Update API

Used to update data into Data Table.

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

PUT https://{{host}}/api/public/tables/{{tableName}}

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
tableName Name of the table to update data

Body Parameters

Parameter Description
query Filter criteria identifying the row to be updated

 "query":{
	"expressions": [
	   {"field": "<col1_name>", "operand": "=/!=/</>", "value": "<value1>"},
	   {"field": "<col2_name>", "operand": "=/!=/</>", "value": "<value2>"}
	],
	"operator": "and/or"
	   }
data Object with the column_name: value pairing for the columns to be updated

"data": {
        "<col1_name>": "<value1>",
        "<col2_name>": "<value2>",
   }

Authorization

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

auth: {{JWT}}

Response content type

application/json

Sample Request

curl -X PUT \
  http://{{host}}/api/public/tables/{{tableName}} \
  -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": "and"
	   },
      "data": {
        "First_Name": "Jane",
        "Last_Name": "Smith",
        "Number": 3453
    }
}'

Sample Response

{
 "records": [
    {
     "_id": "5e7ef67172034b399ace6b03",
     "First_Name": "Jane",
     "Last_Name": "Smith",
     "Gender": "Female",
     "Number": 3453,
     "Updated_On": "2020-03-28T07:51:32.502Z",
     "Created_On": "2019-03-28T07:02:09.652Z",
     "Updated_By": "st-98e05480-0257-5e35-b6d2-66a323834f9d",
     "Created_By": "st-98e05480-0257-5e35-b6d2-66a323834f9d",
     "sys_Id": "sys-545dae21-8675-5a95-9c1b-a223bc6f4bc8"
     }
    ]
}