logo
Desarrollo
Buscar
Add Table Data

Add Table Data

This API supports adding up to 1000 rows of data in a single operation to the specified Agent's data table for use and query in conversations.

Note:

  • The value length of the field with unique enabled cannot exceed 256 characters.
  • The value length of the field without unique enabled cannot exceed 4294967295 characters (actually limited by network issues, it is recommended to control the data length).

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"
            }
        }
    ]
}'

                    
Este bloque de código en una ventana flotante

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": "success", "data": [ "673e9cda9f7bc178002dbd9c" ] }
                      
                      {
    "code": 0,
    "message": "success",
    "data": [
        "673e9cda9f7bc178002dbd9c"
    ]
}

                    
Este bloque de código en una ventana flotante

Successful Response

Field Type Description
code int The type code of the message.
message string Description of the message.
data object The task ID for this table data addition operation, only one ID will be returned.

Failed Response

Field Type Description
code int Error code.
message string Error details.

Error Codes

Code Message
40000 Parameter error
50000 Internal system error