Add Table Data
Última actualización:

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

        
Este bloque de código en la 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": "OK", "data": [ "673e9cda9f7bc178002dbd9c" ] }
          {
    "code": 0,
    "message": "OK",
    "data": [
        "673e9cda9f7bc178002dbd9c"
    ]
}

        
Este bloque de código en la ventana flotante

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