百度智能云

All Product Document

          Object Storage

          Push ImageOcr and ImageClassify Messages

          Interface Description

          This interface 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 overload protection, it returns “Status Code: 429 Too Many Requests” and retries after a while.

          Request URI

          POST /v1/{bucketName}/?result

          Parameter Name Parameter Type Required? Description Example Value Parameter Position
          bucketName String Yes "bucketName_example" Path

          Request Body Parameters

          Instructions for Data Structure of Request Body Field

          Parameter Name Parameter type Required? Description Example Value
          events List Yes

          Data Structure Description of Events Field

          Parameter Name Parameter Type Required? Description Example Value
          version String No The Event version, whose current version is 1.0. 1.0
          eventType String No Event type PutObject
          eventTime String Yes Event occurrence time (GMT format) 2009-10-28T22:32:00Z
          content Content Yes Specific event information
          imageOcr ImageOcr Yes
          imageClassify ImageClassify Yes

          Data Structure Description of Content Field

          Parameter Name Parameter type Required Description Example value
          domain String Yes Domain bj.bcebos.com
          bucket String Yes Affiliated bucket bucket-test
          object String Yes Object name images/test.jpg
          eTag String Yes eTag of object. If an object may be overwritten, eTag is required to judge which version of the object triggers the event. 977b9623a15e520c663ac5ff6647e881

          Description of Data Structure for ImageOcr Field

          Parameter Name Parameter Type Required Description Example Value
          log_id Integer Yes 153673668620866
          result String Yes The actual events are ImageOcr and ImageClassify. For more information, please see AI Universal Character Recognition and AI Universal Image Analysis.

          Data Structure Description of ImageClassify Field

          Parameter Name Parameter Type Required? Description Example Value
          log_id Integer Yes 6353842115261500000
          result_num Integer Yes 1
          result List Yes

          Response Body Parameters

          Description of Data Structure for Response Body Field

          Request Example

          POST /v1/bucketName_example/?result
          Common Request Header
          
          
          {
            "events" : [ {
              "imageOcr" : {
                "result" : "result",
                "log_id" : 153673668620866
              },
              "eventTime" : "2009-10-28T22:32:00Z",
              "imageClassify" : {
                "result" : [ {
                  "score" : 0.566877,
                  "root" : "Character - Features",
                  "keyword" : "Ponytail"
                } ],
                "log_id" : 6353842115261500000,
                "result_num" : 1
              },
              "eventType" : "PutObject",
              "version" : "1.0",
              "content" : {
                "bucket" : "bucket-test",
                "domain" : "bj.bcebos.com",
                "eTag" : "977b9623a15e520c663ac5ff6647e881",
                "object" : "images/test.jpg"
              }
            } ]
          }

          Response Example

          HTTP/1.1 200 OK
          <Common response header>
          
          { }

          Error Code

          Refer to the universal error code.

          Previous
          Push Event Messages
          Next
          Set Bucket Notification Rule