Overview
You can call an API operation to push collected data to a specified application.
Supported HTTP request method
POST
URL
/v3/openapi/app-groups/{appName}/data-collections/{dataCollectionName}/data-collection-type/{dataCollectionType}/actions/bulk
Replace the appName parameter with the name of your OpenSearch application.
Replace the dataCollectionName parameter with the name of your collection of data to be pushed. By default, set this parameter to the name of your OpenSearch application.
Replace the dataCollectionType parameter with the type of your data to be pushed. Valid values are USER, ITEM_INFO, BEHAVIOR, and INDUSTRY_SPECIFIC.
The sample URL omits information such as parameters in the request header and the endpoint that is used to connect to OpenSearch. For more information about the complete request structure, see Request structure.
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 to be performed on the documents. In this topic, set this parameter to ADD. |
fields | Map | Yes | A collection of fields. |
fields parameter
The value of the fields parameter is a collection of fields in a specified table. OpenSearch supports the following types of tables with different schemas: user tables, item tables, and behavior tables. For example, if you want to push data to a behavior table, the fields parameter must contain the fields that are defined in the behavior table. For more information, see Behavior tables.
Parameter | Type | Required | Description |
---|---|---|---|
field1 | xxx | Yes | A field in the specified table. |
field2 | xxx | Yes | A field in the specified table. |
Response parameters
Parameter | Type | Description |
---|---|---|
errors | List | The error details. |
status | String | The returned status. |
request_id | String | The ID of the request. |
result | Boolean | The instance details. |
Example
Sample request
POST /v3/openapi/app-groups/zhao_special/data-collections/zhao_special/data-collection-type/behavior/actions/bulk
[
{
"cmd": "ADD",
"fields": {
"sdk_type": "opensearch_sdk",
"sdk_version": "3.2.0",
"user_id": "10469628",
"biz_id": "poper",
"trace_id": "231084198510103333",
"item_id": "id",
"item_type": "item",
"bhv_type": "click",
"reach_time": "20190730105931"
}
}
]
Sample success response
{
"errors": [],
"request_id": "155084740119723291017595",
"status": "OK",
"result": true
}