テーブルデータ追加の処理ステータスを確認
テーブルデータ追加の処理ステータスを確認
このAPIを使用するとデータベーステーブルへのデータ追加処理の進行状況(ステータス)を確認できます。
リクエストメソッド
GET
エンドポイント
https://api-${endpoint}.gptbots.ai/v1/database/query/import-results
認証
認証方法の説明についてはAPI Overviewをご参照ください。
リクエスト
リクエスト例
curl -X GET 'https://api-${endpoint}/v1/database/query/import-results?ids=68ec7ad3e307920f002648cd' \
-H 'Authorization: Bearer ${API Key}'
curl -X GET 'https://api-${endpoint}/v1/database/query/import-results?ids=68ec7ad3e307920f002648cd' \
-H 'Authorization: Bearer ${API Key}'
このコードブロックをポップアップで表示
リクエストヘッダー
| フィールド | タイプ | 説明 |
|---|---|---|
| Authorization | Bearer ${API Key} | 認証には Authorization: Bearer ${API Key} を使用してください。トークンはAPIキーページから取得できます。 |
クエリパラメータ
| フィールド | タイプ | 必須 | 説明 |
|---|---|---|---|
| ids | List | 必須 | データ追加タスクのIDリスト。複数のタスクIDを指定して、それぞれの処理ステータスを取得することが可能です。 |
レスポンス
レスポンス例
[
{
"id": "68ec7ad3e307920f002648cd",
"progress": 1,
"status": "FAIL",
"total_count": 4,
"success_count": 0,
"fail_count": 4,
"fail_detail": [
{
"row": null,
"row_number_start": 1,
"row_number_end": 2,
"fail_reason": "(1062, \"Duplicate entry '14' for key 'product_feed_090833.id'\")"
},
{
"row": 2,
"row_number_start": 0,
"row_number_end": 0,
"fail_reason": "`id` must be unique, but the value '14' is duplicated (first at row `1`)."
},
{
"row": 4,
"row_number_start": 0,
"row_number_end": 0,
"fail_reason": "`no` is required and must have a value; the current value is invalid or the property is missing. `no` must be unique, but the value is empty or the property is missing."
}
]
}
]
[
{
"id": "68ec7ad3e307920f002648cd",
"progress": 1,
"status": "FAIL",
"total_count": 4,
"success_count": 0,
"fail_count": 4,
"fail_detail": [
{
"row": null,
"row_number_start": 1,
"row_number_end": 2,
"fail_reason": "(1062, \"Duplicate entry '14' for key 'product_feed_090833.id'\")"
},
{
"row": 2,
"row_number_start": 0,
"row_number_end": 0,
"fail_reason": "`id` must be unique, but the value '14' is duplicated (first at row `1`)."
},
{
"row": 4,
"row_number_start": 0,
"row_number_end": 0,
"fail_reason": "`no` is required and must have a value; the current value is invalid or the property is missing. `no` must be unique, but the value is empty or the property is missing."
}
]
}
]
このコードブロックをポップアップで表示
システムはデフォルトで10行を1つのchunkとして分割し、エラーの理由はそのchunk内の最初の行で発生したエラーの内容となります。
成功時のレスポンス
| フィールド | タイプ | 説明 |
|---|---|---|
| id | string | タスクの一意なID。 |
| progress | int | タスクの進捗率(1〜100で表示)。 |
| status | string | タスクの状態。 "FAIL" は失敗、"PENDING_PARSE" はファイル解析中、"AVAILABLE" は少なくとも1件のデータが正常に追加されたことを示します。 |
| total_count | int | 処理対象の総件数。 |
| success_count | int | 成功した件数。 |
| fail_count | int | 失敗した件数。 |
| fail_detail | Array<Object> | 追加に失敗したオブジェクトの位置と理由。 |
| row | int | エラーが発生した行番号。null の場合、特定の行に対応できません。 |
| row_number_start | int | エラー発生範囲の開始行(10行単位で表示)。 |
| row_number_end | int | エラー発生範囲の終了行(10行単位で表示)。 |
| fail_reason | string | エラーの原因説明。 |
エラー時のレスポンス
| フィールド | タイプ | 説明 |
|---|---|---|
| code | Int | エラーコード |
| message | String | エラーの詳細 |
エラーコード
| コード | メッセージ |
|---|---|
| 50000 | システム内部エラー |
レスポンス情報の読み方
失敗パターン1:インポートするデータがデータテーブル内の既存データと衝突した場合、すべてのデータはインポートされません。
"fail_count"の数は"total_count"と同じになります。"row"はnullと表示されます。- この場合は
"fail_reason"を確認して問題を特定してください。 "row_number_start"と"row_number_end"は実際の行数と異なる可能性があるため、無視してください。
失敗パターン2:インポートするデータ内で自身に衝突がある場合、最初のデータのみがインポートされ、2件目以降は破棄されます。
"row"は衝突した2件目のデータの行番号を示します。"row_number_start"と"row_number_end"は 0 になります。
その他の失敗:インポートデータが規定に合わない場合、そのデータはインポートされません。
"row"は規定に合わないデータの行番号を示します。"row_number_start"と"row_number_end"は 0 になります。
