- Print
- DarkLight
b2_get_bucket_notification_rules
- Print
- DarkLight
Lists bucket event notification rules alphabetically by rule name
This will return an error if called on a non-existent bucketId
.
An account authorization token, obtained from b2_authorize_account.
The token must have the readBucketNotifications
capability.
The unique identifier for the bucket containing the event notification rules.
The request succeeded.
[
{
"bucketId": "aea8c5bc362ae55070130333",
"eventNotificationRules": [
{
"eventTypes": [
"b2:ObjectCreated:Upload",
"b2:ObjectCreated:MultipartUpload"
],
"isEnabled": true,
"isSuspended": false,
"name": "mySampleRule1",
"objectNamePrefix": "",
"suspensionReason": "",
"targetConfiguration": {
"customHeaders": [
{
"name": "X-My-Custom-Header-1",
"value": "myCustomHeaderVal1"
},
{
"name": "X-My-Custom-Header-2",
"value": "myCustomHeaderVal2"
}
],
"hmacSha256SigningSecret": "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0",
"targetType": "webhook",
"url": "https://www.example.com/sampleurl"
}
}
]
}
]
The unique identifier for the bucket containing the event notification rules.
An array of Event Notification Rules.
The list of event types for the event notification rule.
Whether the event notification rule is enabled.
Whether the event notification rule is suspended.
A name for the event notification rule. The name must be unique among the bucket's notification rules.
Specifies which object(s) in the bucket the event notification rule applies to.
A brief description of why the event notification rule was suspended.
The target configuration for the event notification rule.
This object will always contain the targetType
field. Currently, the only valid value for targetType
is "webhook."
The fields for "webhook" objects are defined below. However, other targetType
values and collections of fields will be available in the future.
When present, additional header name/value pairs to be sent on the webhook invocation.
The name of the header.
The value of the header
The signing secret for use in verifying the X-Bz-Event-Notification-Signature
.
The type of the target configuration, currently "webhook" only.
The URL for the webhook.
status | code | description |
---|---|---|
400 | bad_bucket_id | bucketId is not valid. |
The numeric HTTP status code. Always matches the status in the HTTP response.
A single-identifier code that identifies the error.
A human-readable message, in English, saying what went wrong.
status | code | description |
---|---|---|
401 | bad_auth_token | The auth token used is not valid. Call b2_authorize_account again to either get a new one, or an error message describing the problem. |
401 | expired_auth_token | The auth token used has expired. Call b2_authorize_account again to get a new one. |
401 | unauthorized | The auth token used is valid, but does not authorize this call with these parameters. The capabilities of an auth token are determined by the application key used with b2_authorize_account. |
status | code | description |
---|---|---|
403 | transaction_cap_exceeded | Transaction cap exceeded. To increase your cap, sign in to your B2 Cloud Storage account online. Then select the Caps & Alerts link in the B2 Cloud Storage section of the sidebar. |