Watch for changes on all objects in a bucket.
Request
HTTP request
POST https://storage.googleapis.com/storage/v1/b/ bucket /o/watch
In addition to standard query parameters , the following query parameters apply to this method.
To see an example of how to include query parameters in a request, see the JSON API Overview page.
Parameters
bucket
string
delimiter
string
watchAll
method.endOffset
string
watchAll
method.includeTrailingDelimiter
integer
watchAll
method.maxResults
integer
watchAll
method.pageToken
string
watchAll
method.prefix
string
watchAll
method.projection
string
watchAll
method.startOffset
string
watchAll
method.versions
boolean
watchAll
method.Request body
In the request body, supply data with the following structure:
{ "kind" : "api#channel" , "id" : string , "resourceId" : string , "resourceUri" : string , "token" : string , "expiration" : " long " , "type" : string , "address" : string , "payload" : boolean , "params" : { ( key ) : string } }
Property name | Value | Description | Notes |
---|---|---|---|
kind
|
string
|
Identifies this as a notification channel used to watch for changes to a resource.
This value is always "api#channel"
. |
|
id
|
string
|
A UUID or similar unique string that identifies this channel. | |
resourceId
|
string
|
An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. | |
resourceUri
|
string
|
A version-specific identifier for the watched resource. | |
token
|
string
|
An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. | |
expiration
|
long
1
|
Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. | |
type
|
string
|
The type of delivery mechanism used for this channel. This value is always "WEBHOOK"
. |
|
address
|
string
|
The address where notifications are delivered for this channel. | |
params
|
object
|
Additional parameters controlling delivery channel behavior. Optional. | |
params.(key)
|
string
|
Declares a new parameter by name. | |
payload
|
boolean
|
A Boolean value to indicate whether payload is wanted. Optional. |
Response
If successful, this method returns a response body with the following structure:
{ "kind" : "api#channel" , "id" : string , "resourceId" : string , "resourceUri" : string , "token" : string , "expiration" : " long " , "type" : string , "address" : string , "payload" : boolean , "params" : { ( key ) : string } }
Property name | Value | Description | Notes |
---|---|---|---|
kind
|
string
|
Identifies this as a notification channel used to watch for changes to a resource.
This value is always "api#channel"
. |
|
id
|
string
|
A UUID or similar unique string that identifies this channel. | |
resourceId
|
string
|
An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. | |
resourceUri
|
string
|
A version-specific identifier for the watched resource. | |
token
|
string
|
An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. | |
expiration
|
long
1
|
Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. | |
type
|
string
|
The type of delivery mechanism used for this channel. | |
address
|
string
|
The address where notifications are delivered for this channel. | |
params
|
object
|
Additional parameters controlling delivery channel behavior. Optional. | |
params.(key)
|
string
|
Declares a new parameter by name. | |
payload
|
boolean
|
A Boolean value to indicate whether payload is wanted. Optional. |
For information about status and error codes returned by this API, see the reference page .
Try it!
Use the APIs Explorer below to call this method on live data and see the response.