Add Table Data
最新の更新:
Add Table Data
This API supports adding up to 1000 rows of data in a single operation to the specified Bot's data table for use and query in conversations.
Request Method
POST
Endpoint
https://api.gptbots.ai/v1/database/import/records
Authentication
Refer to the API Overview for the authentication method explanation.
Request
Request Example
curl -X POST https://api.gptbots.ai/v1/database/import/records \
-H 'Authorization: Bearer your_apikey' \
-H 'Content-Type: application/json' \
-d '{
"table_id": "673af861ed69656ac0895b07",
"records": [
{
"values": {
"id": "7424489",
"name": "4455566777777"
}
},
{
"values": {
"id": "7852549",
"name": "446656677665"
}
}
]
}'
curl -X POST https://api.gptbots.ai/v1/database/import/records \
-H 'Authorization: Bearer your_apikey' \
-H 'Content-Type: application/json' \
-d '{
"table_id": "673af861ed69656ac0895b07",
"records": [
{
"values": {
"id": "7424489",
"name": "4455566777777"
}
},
{
"values": {
"id": "7852549",
"name": "446656677665"
}
}
]
}'
このコードブロックは、フローティングウィンドウに表示されます
Request Headers
Field | Type | Description |
---|---|---|
Authorization | Bearer ${token} | Use Authorization: Bearer ${token} for authentication. Obtain the token from the API Key page. |
Content-Type | application/json | Data type, set to application/json. |
Request Body
Field | Type | Required | Description |
---|---|---|---|
records | list | Yes | The collection of data to be imported. |
table_id | string | Yes | ID of the table. |
Response
Response Example
{
"code": 0,
"message": "OK",
"data": [
"673e9cda9f7bc178002dbd9c"
]
}
{
"code": 0,
"message": "OK",
"data": [
"673e9cda9f7bc178002dbd9c"
]
}
このコードブロックは、フローティングウィンドウに表示されます
Successful Response
Field | Type | Description |
---|---|---|
code | int | The type code of the message. |
message | string | Description of the message. |
data | object | Response content, which is the unique identifier of the data table. |
Failed Response
Field | Type | Description |
---|---|---|
code | int | Error code. |
message | string | Error details. |
Error Codes
Code | Message |
---|---|
40000 | Parameter error |
50000 | Internal system error |