Push Event Messages
Last Updated:2021-09-13
Interface Description
It is sued 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:
- Status Code: 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 period of time.
Request URI
POST /v1/{bucketName}/?event
Parameter Name | Parameter type | Required | Description | Example value | Parameter position |
---|---|---|---|---|---|
bucketName | String | Yes | Bucket name | "bucketName_example" | Path |
Request Body Parameters
Instructions for Data Structure of Request Body Field
Parameter name | Parameter type | Required | Description | Example value |
---|---|---|---|---|
events | List<Events> | No |
Data Structure Description of Events Field
Parameter Name | Parameter type | Required | Description | Example value |
---|---|---|---|---|
version | String | No | The Event version, whose current is 1.0. | 1.0 |
eventId | String | No | Unique event ID | 2a513199-bbb9-4ac7-b12a-60213c26810d |
eventOrigin | String | No | Event trigger origin, which currently supports the increment (bos: realtime). | bos:realtime |
eventTime | String | No | Event occurrence time (GMT format) | 2018-09-05T02:28:49Z |
eventType | String | No | Event type | PutObject |
content | Content | No | Specific event information |
Data Structure Description of Content Field
Parameter Name | Parameter type | Required | Description | Example value |
---|---|---|---|---|
userId | String | No | User id | c7ac82ae14ef42d1a4ffa3b2ececa17f |
domain | String | No | Domain | bj.bcebos.com |
bucket | String | No | Affiliated bucket | bucket-test |
object | String | No | Object name | images/test.jpg |
eTag | String | No | eTag of object. If an object may be overwritten, eTag is required to judge which version of the object triggers the event. | 977b9623a15e520c663ac5ff6647e881 |
contentType | String | No | object的Content-Type | application/octet-stream |
filesize | Integer | No | File size | 24414 |
lastModified | String | No | File update time | 2018-09-05T02:28:49Z |
credentials | Credentials | No | Temporary authorization of relevant resources. For the specific usage, see Temporary Authorized Access. | |
xVars | String | No | xVars original text in the user setting notification | {"saveUrl": "http://xxx.com/ocr"} |
Data Structure Description of Credentials Field
Parameter Name | Parameter type | Required | Description | Example value |
---|---|---|---|---|
accessKeyId | String | No | temporary authorization The Access Key ID does not | f3ade7c6b1a911e8bb6821a724cc157d |
secretAccessKey | String | No | // User’s Access Key ID and Secret Access Key | 07381a56d35e4b1193a418362221de81 |
sessionToken | String | No | 临时授权的Session Token | ZGZiM2M3MmU4Mjk4NGQ2MGEzYTNhYTAyMDE3NTZmZmV8AAAAAIcCAADaE18IR6jSaVWlMHxZG5wzb/7AQas3Y6V |
expiration | String | No | Effective time of temporary authorization | 2018-02-22T11:22:33Z |
Response Body Parameters
Instructions for Data Structure of Response Body Field
Request Example
POST /v1/bucketName_example/?event
Common Request Header
{
"events" : [ {
"eventId" : "2a513199-bbb9-4ac7-b12a-60213c26810d",
"eventTime" : "2018-09-05T02:28:49Z",
"eventType" : "PutObject",
"version" : "1.0",
"content" : {
"bucket" : "bucket-test",
"credentials" : {
"accessKeyId" : "f3ade7c6b1a911e8bb6821a724cc157d",
"secretAccessKey" : "07381a56d35e4b1193a418362221de81",
"sessionToken" : "ZGZiM2M3MmU4Mjk4NGQ2MGEzYTNhYTAyMDE3NTZmZmV8AAAAAIcCAADaE18IR6jSaVWlMHxZG5wzb/7AQas3Y6V",
"expiration" : "2018-02-22T11:22:33Z"
},
"domain" : "bj.bcebos.com",
"xVars" : "{\"saveUrl\": \"http://xxx.com/ocr\"}",
"eTag" : "977b9623a15e520c663ac5ff6647e881",
"filesize" : 24414,
"lastModified" : "2018-09-05T02:28:49Z",
"userId" : "c7ac82ae14ef42d1a4ffa3b2ececa17f",
"contentType" : "application/octet-stream",
"object" : "images/test.jpg"
},
"eventOrigin" : "bos:realtime"
} ]
}
Response Example
HTTP/1.1 200 OK
<Common response header>
{ }
Error code
See universal error code