GetNotification
Updated at:2025-11-03
API description
This API retrieves notification rules for a specified bucket.
Request
-
Request syntax
Plain Text1http 2GET /?notification HTTP/1.1 3Host: <BucketName>.bj.bcebos.com 4Date: <Date> 5Authorization: <AuthorizationString> -
Request headers
None
-
Request parameters
None
Response
| Field | Types | Necessity | Description |
|---|---|---|---|
| id | String | Required | Rule ID |
| name | String | Optional | Rule name |
| appId | String | Required | Product ID for registering this rule |
| status | String | Required | Options: {"disabled", "enabled"} |
| encryption | Object | Optional | Encryption method |
| +key | String | Optional | Encryption key. If it is not empty, the IAM algorithm is used to sign the notification request, where the key corresponds to the SecretAccessKey in the IAM signature. |
| resources[] | Array | Required | Subscribed resources |
| +resource | String | Required | Subscribed resources: ${bucket_name}/path1/*.jpg or /path1/*.jpg, with a maximum of only one * |
| events[] | Array | Required | Subscribed events |
| +eventType | String | Required | Event types supported currently: - PutObject: normal upload of object - PostObject: Form upload of object - AppendObject: Append upload of object - CopyObject: Copy object - CompleteMultipartUpload: Complete multipart upload of object - FetchObject: Fetch object, including fetching generated by image back-to-origin operation - DeleteObject: Delete object - DeleteMultipleObjects: Delete multiple objects. - "BosLifecycle:Copy": Replication events triggered by lifecycle, including CopyObject requests and the third step of CompleteMultipartUpload requests of multipart replication. |
| apps[] | Array | Required | The product subscribed to for messages |
| +id | String | Required | Product ID to be notified |
| +eventUrl | String | Required | URL for processing event notification. Options: {"http", "https", "brn", "app"}. http/https are for custom applications, brn for CFC notifications, and app for official applications. |
| +xVars | String | Optional | Custom parameters passed through. They are transparent to the framework, used for self-return values of the service. For official AI applications, this is a stringified JSON containing a saveUrl address to receive processing results. |
Example
-
Request example
Plain Text1http 2GET /?notification HTTP/1.1 3Host: <BucketName>.bj.bcebos.com 4Date: Wed, 12 Sep 2018 06:34:40 GMT 5Authorization: AuthorizationString -
Response example
Plain Text1HTTP/1.1 200 OK 2x-bce-request-id: 4db2b34d-654d-4d8a-b49b-xxxxxx786409 3Date: Wed, 12 Sep 2018 06:34:40 GMT 4Content-Length: 0 5Connection: close 6Server: BceBos 7{ 8 "notifications": [ 9 { 10 "id": "notify-id-1", 11 "name": "rule-name", 12 "appId": "app-id-1", 13 "status": "enabled", 14 "resources": [ 15 "bucket-a/path1", "/path2", "/path3/*.jpg", "/path4/*" 16 ], 17 "events": [ 18 "PutObject" 19 ], 20 "apps": [ 21 { 22 "id": "app-id-1", 23 "eventUrl": "http://xxx.com/event", 24 "xVars": "" 25 }, 26 { 27 "id": "app-id-2", 28 "eventUrl": "brn:bce:cfc:bj:1f1c3e383c31e6467c4c44523f0d5b22:function:hello_bos:$LATEST" 29 }, 30 { 31 "id": "app-id-3", 32 "eventUrl": "app:ImageOcr", 33 "xVars": "{\"saveUrl\": \"http://xxx.com/ocr\"}" 34 } 35 ] 36 } 37 ] 38}
