PostEvent
Last Updated:2021-12-08
Interface Description
It is used to push the event message to the configured URL.
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 /?event HTTP/1.1 Host: <User_Host> Date: <Date> Content-Type: application/json; charset=utf-8 Content-Length: <Content_Length> Authorization: <AuthorizationString>
-
Request header field
None
-
Query parameters
Field | Type | Description |
---|---|---|
version | String | Event version. The current version is 1.0 . |
eventId | String | Unique event ID |
eventOrigin | String | Event triggering origin, which supports the increment (bos:realtime ) currently. |
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. |
+contentType | String | Object Content-Type |
+filesize | Number | File size |
+lastModified | String | File update time |
+credentials | Object | Temporary authorization of relevant resources. For the specific usage, see Temporary Access Authorization. |
++accessKeyId | String | Access Key ID for the temporary authorization |
++secretAccessKey | String | Secret Access Key for the temporary authorization |
++sessionToken | String | Session Token for the temporary authorization |
++expiration | String | Effective time of the temporary authorization |
++xVars | String | xVars original text in the user setting notification |
Response
Example
-
Request example
``` http POST /?event 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", "eventId": "2a513199-bbb9-4ac7-b12a-60213c26810d", "eventOrigin": "bos:realtime", "eventTime": "2018-09-05T02:28:49Z", "eventType": "PutObject", "content": { "userId": "c7ac82ae14ef42d1a4ffa3b2ececa17f", "domain": "bj.bcebos.com", "bucket": "bucket-test", "object": "images/test.jpg", "eTag": "977b9623a15e520c663ac5ff6647e881", "contentType": "application/octet-stream", "filesize": 24414, "lastModified": "2018-09-05T02:28:49Z", "credentials": { "accessKeyId": "f3ade7c6b1a911e8bb6821a724cc157d", "secretAccessKey": "07381a56d35e4b1193a418362221de81", "sessionToken": "ZGZiM2M3MmU4Mjk4NGQ2MGEzYTNhYTAyMDE3NTZmZmV8AAAAAIcCAADaE18IR6jSaVWlMHxZG5wzb/7AQas3Y6V", "expiration": "2018-02-22T11:22:33Z" }, "xVars": "{\"saveUrl\": \"http://xxx.com/ocr\"}" } } ] } ```
-
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