Skip to content

Commit

Permalink
docs: announce that ListAudienceLists, GetAudienceList, `QueryAud…
Browse files Browse the repository at this point in the history
…ienceList`, `CreateAudienceList` methods are now available in the v1beta version of the Data API

feat: add the `webhook_notification` field to the `RecurringAudienceList` resource

feat: add the `webhook_notification` field to the `AudienceList` resource

feat: add the `WebhookNotification` type
PiperOrigin-RevId: 600815983
  • Loading branch information
Google APIs authored and copybara-github committed Jan 23, 2024
1 parent 708f769 commit b76a27e
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 17 deletions.
1 change: 0 additions & 1 deletion google/analytics/data/v1alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ load(

csharp_proto_library(
name = "data_csharp_proto",
extra_opts = [],
deps = [":data_proto"],
)

Expand Down
117 changes: 101 additions & 16 deletions google/analytics/data/v1alpha/analytics_data_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,10 @@ service AlphaAnalyticsData {
// https://support.google.com/analytics/answer/9267572. Audience lists contain
// the users in each audience.
//
// This method is introduced at alpha stability with the intention of
// gathering feedback on syntax and capabilities before entering beta. To give
// your feedback on this API, complete the
// [Google Analytics Audience Export API
// Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
// This method is available at beta stability at
// [audienceExports.create](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/create).
// To give your feedback on this API, complete the [Google Analytics Audience
// Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
rpc CreateAudienceList(CreateAudienceListRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
Expand Down Expand Up @@ -119,11 +118,10 @@ service AlphaAnalyticsData {
// that are important to your business. To learn more, see
// https://support.google.com/analytics/answer/9267572.
//
// This method is introduced at alpha stability with the intention of
// gathering feedback on syntax and capabilities before entering beta. To give
// your feedback on this API, complete the
// [Google Analytics Audience Export API
// Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
// This method is available at beta stability at
// [audienceExports.query](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/query).
// To give your feedback on this API, complete the [Google Analytics Audience
// Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
rpc QueryAudienceList(QueryAudienceListRequest)
returns (QueryAudienceListResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -168,9 +166,9 @@ service AlphaAnalyticsData {
// List](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
// for an introduction to Audience Lists with examples.
//
// This method is introduced at alpha stability with the intention of
// gathering feedback on syntax and capabilities before entering beta. To give
// your feedback on this API, complete the
// This method is available at beta stability at
// [audienceExports.get](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/get).
// To give your feedback on this API, complete the
// [Google Analytics Audience Export API
// Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
rpc GetAudienceList(GetAudienceListRequest) returns (AudienceList) {
Expand All @@ -189,9 +187,9 @@ service AlphaAnalyticsData {
// List](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics)
// for an introduction to Audience Lists with examples.
//
// This method is introduced at alpha stability with the intention of
// gathering feedback on syntax and capabilities before entering beta. To give
// your feedback on this API, complete the
// This method is available at beta stability at
// [audienceExports.list](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties.audienceExports/list).
// To give your feedback on this API, complete the
// [Google Analytics Audience Export API
// Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
rpc ListAudienceLists(ListAudienceListsRequest)
Expand Down Expand Up @@ -344,6 +342,75 @@ message RecurringAudienceList {
// This list is ordered with the most recently created audience list first.
repeated string audience_lists = 6
[(google.api.field_behavior) = OUTPUT_ONLY];

// Optional. Configures webhook notifications to be sent from the Google
// Analytics Data API to your webhook server. Use of webhooks is optional. If
// unused, you'll need to poll this API to determine when a recurring audience
// list creates new audience lists. Webhooks allow a notification to be sent
// to your servers & avoid the need for polling.
//
// Two POST requests will be sent each time a recurring audience list creates
// an audience list. This happens once per day until a recurring audience list
// reaches 0 active days remaining. The first request will be sent showing a
// newly created audience list in its CREATING state. The second request will
// be sent after the audience list completes creation (either the ACTIVE or
// FAILED state).
optional WebhookNotification webhook_notification = 8
[(google.api.field_behavior) = OPTIONAL];
}

// Configures a long-running operation resource to send a webhook notification
// from the Google Analytics Data API to your webhook server when the resource
// updates.
//
// Notification configurations contain private values & are only visible to your
// GCP project. Different GCP projects may attach different webhook
// notifications to the same long-running operation resource.
message WebhookNotification {
// Optional. The web address that will receive the webhook notification. This
// address will receive POST requests as the state of the long running
// operation resource changes. The POST request will contain both a JSON
// version of the long running operation resource in the body and a
// `sentTimestamp` field. The sent timestamp will specify the unix
// microseconds since the epoch that the request was sent; this lets you
// identify replayed notifications.
//
// An example URI is
// `https://us-central1-example-project-id.cloudfunctions.net/example-function-1`.
//
// The URI must use HTTPS and point to a site with a valid SSL certificate on
// the web server. The URI must have a maximum string length of 128 characters
// & use only the allowlisted characters from [RFC
// 1738](https://www.rfc-editor.org/rfc/rfc1738).
//
// When your webhook server receives a notification, it is expected to reply
// with an HTTP response status code of 200 within 5 seconds.
//
// A URI is required to use webhook notifications.
//
// Requests to this webhook server will contain an ID token authenticating the
// service account
// `[email protected]`. To learn
// more about ID tokens, see
// https://cloud.google.com/docs/authentication/token-types#id. For Google
// Cloud Functions, this lets you configure your function to require
// authentication. In Cloud IAM, you will need to grant the service account
// permissions to the Cloud Run Invoker (`roles/run.invoker`) & Cloud
// Functions Invoker (`roles/cloudfunctions.invoker`) roles for the webhook
// post request to pass Google Cloud Functions authentication. This API can
// send webhook notifications to arbitrary URIs; for webhook servers other
// than Google Cloud Functions, this ID token in the authorization bearer
// header should be ignored if it is not needed.
optional string uri = 1 [(google.api.field_behavior) = OPTIONAL];

// Optional. The channel token is an arbitrary string value and must have a
// maximum string length of 64 characters. Channel tokens allow you to verify
// the source of a webhook notification. This guards against the message being
// spoofed. The channel token will be specified in the `X-Goog-Channel-Token`
// HTTP header of the webhook POST request.
//
// A channel token is not required to use webhook notifications.
optional string channel_token = 2 [(google.api.field_behavior) = OPTIONAL];
}

// A request to retrieve configuration metadata about a specific recurring
Expand Down Expand Up @@ -547,6 +614,24 @@ message AudienceList {
// recurring audience list, and this field will be blank.
optional string recurring_audience_list = 12
[(google.api.field_behavior) = OUTPUT_ONLY];

// Optional. Configures webhook notifications to be sent from the Google
// Analytics Data API to your webhook server. Use of webhooks is optional. If
// unused, you'll need to poll this API to determine when an audience list is
// ready to be used. Webhooks allow a notification to be sent to your servers
// & avoid the need for polling.
//
// Either one or two POST requests will be sent to the webhook. The first POST
// request will be sent immediately showing the newly created audience list in
// its CREATING state. The second POST request will be sent after the audience
// list completes creation (either the ACTIVE or FAILED state).
//
// If identical audience lists are requested in quick succession, the second &
// subsequent audience lists can be served from cache. In that case, the
// audience list create method can return an audience list is already ACTIVE.
// In this scenario, only one POST request will be sent to the webhook.
optional WebhookNotification webhook_notification = 13
[(google.api.field_behavior) = OPTIONAL];
}

// This metadata is currently blank.
Expand Down
6 changes: 6 additions & 0 deletions google/analytics/data/v1alpha/analyticsdata_v1alpha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: Google Analytics Data API

apis:
- name: google.analytics.data.v1alpha.AlphaAnalyticsData
- name: google.longrunning.Operations

types:
- name: google.analytics.data.v1alpha.AudienceListMetadata
Expand Down Expand Up @@ -34,3 +35,8 @@ authentication:
https://www.googleapis.com/auth/drive,
https://www.googleapis.com/auth/drive.file,
https://www.googleapis.com/auth/spreadsheets
- selector: 'google.longrunning.Operations.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/analytics,
https://www.googleapis.com/auth/analytics.readonly

0 comments on commit b76a27e

Please sign in to comment.