Baidu AI Cloud
中国站

百度智能云

Object Storage

PostResult

Interface Description

It is used to push the event message processed by ImageOcr and ImageClassify to the URL set by APP. The content includes BOS event information and AI processing results.

If the encryption field is configured in the rule, the Authorization signature is contained in the request to ensure that the message is not forged or tampered with.

Notes:

  • It is considered that the message is pushed successfully only when it returns Status Code: 200 OK. Otherwise, it retries.
  • For the overload protection, it returns Status Code: 429 Too Many Requests and retries after a period of time.

Request

  • Request syntax

    http
    POST /?result HTTP/1.1
    Host: <User_Host>
    Date: <Date>
    Content-Type: application/json; charset=utf-8
    Content-Length: <Content_Length>
    Authorization: <AuthorizationString>
  • Request parameters

Field Type Description
version String Event version. The current version is 1.0.
eventType String Event type
eventTime String Event occurrence time (GMT format)
content Object Specific event information
+domain String Domain
+bucket String Affiliated bucket
+object String Object name
+eTag String eTag of object. If an object may be overwritten, eTag is required to judge which version of the object triggers the event.
result String The actual event is imageOcr or imageClassify. For more information, see AI Universal Character Recognition and AI Universal Image Analysis
  • Request header field

    None

Response

  • Response header field

    None

  • Response element

    None

Example

  • Request example

    http
    POST /?result HTTP/1.1
    Host: BucketName.bj.bcebos.com
    Date: Wed, 12 Sep 2018 06:34:40 GMT
    Content-Type: application/json; charset=utf-8
    Content-Length: 0
    
    {
        "events": [
            {
                "version": "1.0",
                "eventType": "PutObject",
                "eventTime": "2009-10-28T22:32:00Z",
                "content": {
                    "domain": "bj.bcebos.com",
                    "bucket": "bucket-test",
                    "object": "images/test.jpg",
                    "eTag": "977b9623a15e520c663ac5ff6647e881",
                },
                "imageOcr": {
                    "log_id": 153673668620866,
                    "result": {
                        "ocr": {
                            "log_id": 1078286758436670376,
                            "words_result": [
                                {
                                    "words": "MAKE"
                                }
                            ],
                            "words_result_num": 1,
                            "direction": 0
                        }
                    }
                },
                "imageClassify": {
                    "log_id": 6353842115261500790,
                    "result_num": 1,
                    "result": [
                        {
                            "score": 0.566877,
                            "root": "Character - Features",
                            "keyword": "Ponytail"
                        }
                    ]
                }
            }
        ]
    }
  • Response example

    HTTP/1.1 200 OK
    x-bce-request-id: 4db2b34d-654d-4d8a-b49b-xxxxxx786409
    Date: Wed, 12 Sep 2018 06:34:40 GMT
    Content-Length: 0
    Connection: close
    Server: BceBos
Previous
PostEvent
Next
Lifecycle