All Products
Search
Document Center

:PushDocument

Last Updated:Mar 29, 2021

Description

Pushes documents to specified tables in a specified instance.

Method

POST

URI

/openapi/instances/{instanceId}/tables/{tableName}/actions/bulk

instanceId indicates the ID of an AIRec instance. tableName indicates the name of a table. The following three types of tables are required when you use AIRec for a specific industry: user table, item table, and behavior table.

Request parameters

Parameter

Type

Required

Description

docs

List

Yes

A list of documents.

Document-related parameters

Parameter

Type

Required

Description

cmd

String

Yes

The operation command. Valid values: add, delete, and update.

fields

Map

Yes

The combination of fields from specified tables.

Fields

Tables of different structures are defined for different industries. For more information, see data specifications. The following three types of tables are required for each industry: user table, item table, and behavior table. For example, the existing instance is of the content industry type. You must specify the fields from the user table for the content industry when you push data.

Parameter

Type

Required

Description

field1

xxx

Yes

The field in the table.

field1

xxx

Yes

The field in the table.

Response parameters

Parameter

Type

Description

RequestId

String

The ID of the request. This parameter is a common parameter.

Result

Boolean

Indicates whether data is pushed. Valid values: true and false.

Sample requests

POST /openapi/instances/airec-cn-sdfsd0fask2nsa/tables/user/actions/bulk
[
    {
        "cmd": "add",
        "fields": {
            "user_id": "",
            "user_id_type": "",
           ......
        }
    },
    {
        "cmd": "add",
        "fields": {
            "user_id": "",
            "user_id_type": "",
           ......
        }
    }
]

Sample responses

{
    "RequestId": "8F81A922-6C81-46D6-B78C-CC35E16B1691",
    "Result": true
}