データ挿入(一括)API

Used to insert bulk data into Data Table.

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

POST https://{{host}}/api/public/tables/{{tableName}}/bulk

クエリパラメータ

パラメータ 説明
ホスト 環境URL(例) https://bots.kore.ai
tableName 大量のデータを挿入するテーブルの名前

本文パラメータ

パラメータ 説明
日付 column_name: value pairingを含むオブジェクトの配列

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

認証

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

応答のコンテンツタイプ

application/json

サンプルリクエスト

curl -X POST \ http://{{host}}/api/public/tables/{{tableName}} \ -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \ -H 'content-type: application/json' \ -d '{ "data": [ { "First_Name": "Jane", "Last_Name": "Smith", "Gender": "female", "Number": 263 }, { "First_Name": "Mike", "Last_Name": "Mike", "Gender": "male", "Number": 234 } ] }'

サンプル応答

{ "records": [ { "First_Name": "Jane", "Last_Name": "Smith", "Gender": "female", "Number": 263, "Updated_On": "2020-03-28T07:02:09.652Z", "Created_On": "2020-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" }, { "First_Name": "Mike", "Last_Name": "Mike", "Gender": "male", "Number": 234, "Updated_On": "2020-03-28T07:02:09.652Z", "Created_On": "2020-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 Insert (Bulk) API

Used to insert bulk data into Data Table.

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

POST https://{{host}}/api/public/tables/{{tableName}}/bulk

Query Parameters

Parameter Description
host Environment URL, for example, https://bots.kore.ai
tableName Name of the table to insert bulk data

Body Parameters

Parameter Description
data Array of objects with the column_name: value pairing

"data": [
    {
        "<col1_name>": "<value1>",
        "<col2_name>": "<value2>",
      },
     { 
         "<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 POST \
  http://{{host}}/api/public/tables/{{tableName}} \
  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
  -H 'content-type: application/json' \
  -d '{
      "data": [
         {
          "First_Name": "Jane",
          "Last_Name": "Smith",
          "Gender": "female",
          "Number": 263
         },
         { 
           "First_Name": "Mike", 
           "Last_Name": "Mike", 
           "Gender": "male", 
           "Number": 234 
         }
       ]
     }'

Sample Response

{
"records": [
  {
    "First_Name": "Jane",
    "Last_Name": "Smith",
    "Gender": "female",
    "Number": 263,
    "Updated_On": "2020-03-28T07:02:09.652Z",
    "Created_On": "2020-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"
  },
  { "First_Name": "Mike", 
    "Last_Name": "Mike", 
    "Gender": "male", 
    "Number": 234, 
    "Updated_On": "2020-03-28T07:02:09.652Z", 
    "Created_On": "2020-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" 
   }
]
}