Pushing ImageOcr and ImageClassify Messages
Updated at:2025-11-03
API description
Push event messages processed by the ImageOcr and ImageClassify products to the app-configured URL, including BOS event information and AI processing results.
If the encryption field is configured in the rule, the request will carry an authorization signature to ensure the message is neither forged nor tampered with.
Note:
- Status code: 200 OK can indicate the message push is successful. Otherwise, it shall be retried.
- For overload protection, it supports status code: 429 Too Many Requests return value, and will retry after an interval;
Request URI
POST /v1/{bucketName}/?result
| Parameter name | Parameter type | Required or not | Description | Example value | Parameter location |
|---|---|---|---|---|---|
| bucketName | String | Yes | "bucketName_example" | Path |
Parameters of request body
Description of the data structure of request body fields
| Parameter name | Parameter type | Required or not | Description | Example value |
|---|---|---|---|---|
| events | List |
Yes |
Description of the data structure of the Events field
| Parameter name | Parameter type | Required or not | Description | Example value |
|---|---|---|---|---|
| version | String | No | Event version, currently 1.0 | 1.0 |
| eventType | String | No | Event type | PutObject |
| eventTime | String | Yes | Event occurrence time (in GMT format) | 2009-10-28T22:32:00Z |
| content | Content | Yes | Event details | |
| imageOcr | ImageOcr | Yes | ||
| imageClassify | ImageClassify | Yes |
Description of the data structure of the Content field
| Parameter name | Parameter type | Required or not | Description | Example value |
|---|---|---|---|---|
| domain | String | Yes | Corresponding domain | bj.bcebos.com |
| bucket | String | Yes | Corresponding bucket | bucket-test |
| object | String | Yes | Object name | images/test.jpg |
| eTag | String | Yes | The eTag of the object. If the object may be overwritten, the eTag is used to determine which version of the object triggers the event. | 977b9623a15e520c663ac5ff6647e881 |
Description of the data structure of the ImageOcr field
| Parameter name | Parameter type | Required or not | Description | Example value |
|---|---|---|---|---|
| log_id | Integer | Yes | 153673668620866 | |
| result | String | Yes | According to the actual events, they are imageOcr and imageClassify. For specific contents, please refer to AI General Text Recognition and AI General Image Analysis |
Description of the data structure of the ImageClassify field
| Parameter name | Parameter type | Required or not | Description | Example value |
|---|---|---|---|---|
| log_id | Integer | Yes | 6353842115261500000 | |
| result_num | Integer | Yes | 1 | |
| result | List |
Yes |
Response body parameters
Description of the data structure of response body fields
Request example
JSON
1POST /v1/bucketName_example/?result
2 <Common request headers>
3{
4 "events" : [ {
5 "imageOcr" : {
6 "result" : "result",
7 "log_id" : 153673668620866
8 },
9 "eventTime" : "2009-10-28T22:32:00Z",
10 "imageClassify" : {
11 "result" : [ {
12 "score" : 0.566877,
13 "root": "Image-Portrait",
14 "keyword": "Ponytail"
15 } ],
16 "log_id" : 6353842115261500000,
17 "result_num" : 1
18 },
19 "eventType" : "PutObject",
20 "version" : "1.0",
21 "content" : {
22 "bucket" : "bucket-test",
23 "domain" : "bj.bcebos.com",
24 "eTag" : "977b9623a15e520c663ac5ff6647e881",
25 "object" : "images/test.jpg"
26 }
27 } ]
28}
Response example
JSON
1HTTP/1.1 200 OK
2 <Common response headers>
3{ }
Error code
Please refer to the general error codes
