Query Status of Adding Table Data
Query Status of Adding Table Data
Use this API to query the processing status of tasks for adding table data.
Request Method
GET
Endpoint
https://api-${endpoint}.gptbots.ai/v1/database/query/import-results
Authentication
Refer to the authentication method description in API Overview for details.
Request
Request Example
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}'
This code block in the floating window
Request Headers
Field | Type | Description |
---|---|---|
Authorization | Bearer ${API Key} | Use Authorization: Bearer ${API Key} for authentication. Get API key from API Key page. |
Query Parameters
Field | Type | Required | Description |
---|---|---|---|
ids | list | Yes | Collection of task IDs for adding data. |
Response
Response Example
[
{
"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."
}
]
}
]
This code block in the floating window
Successful Response
Field | Type | Description |
---|---|---|
id | string | The unique ID of the task. |
progress | int | Task progress percentage, ranging from 1 to 100. |
status | string | Task status. "FAIL" means failure, "PENDING_PARSE" means the file is being parsed, and "AVAILABLE" means at least one record was successfully added. |
total_count | int | Total number of items processed. |
success_count | int | Number of successfully processed items. |
fail_count | int | Number of failed items. |
fail_detail | Array<Object> | The positions and reasons for failed additions. |
row | int | Indicates the row number where the error occurred. If null , the error cannot be mapped to a specific row. |
row_number_start | int | Indicates the start of the error range (in blocks of ten rows). |
row_number_end | int | Indicates the end of the error range (in blocks of ten rows). |
fail_reason | string | Description of the reason for the error. |
Failed Response
Field | Type | Description |
---|---|---|
code | int | Error code. |
message | string | Error details. |
Error Codes
Code | Message |
---|---|
50000 | Internal system error |
How to Interpret the Response?
Failure Case 1: If the imported data conflicts with data already in the data table, none of the data will be imported.
- The
"fail_count"
will equal"total_count"
. "row"
will benull
.- In this case, check
"fail_reason"
to locate the issue. "row_number_start"
and"row_number_end"
may not match the actual row numbers, so they can be ignored.
- The
Failure Case 2: If there is a conflict within the imported data itself, the first conflicting record will be imported, and the second will be discarded.
"row"
will show the row number of the second conflicting record."row_number_start"
and"row_number_end"
will be 0.
Other Failures: If the imported data does not meet the required format or rules, that record will not be imported.
"row"
will show the row number of the invalid record."row_number_start"
and"row_number_end"
will be 0.