I want to get notifications when an admin adds a user in a group in Google Workspace. And I call the Watch method to do it:
var channel = new Google.Apis.Admin.Reports.reports_v1.Data.Channel
{
Address = address,
Type = "web_hook",
Token = "token",
Id = "new random guid"
};
var request = reportService.Activities.Watch(
channel,
"all",
ActivitiesResource.WatchRequest.ApplicationNameEnum.Groups
);
var response = await request.ExecuteAsync(token);
- I checked Admin and GroupsEnterprise options instead of Groups - nothing
- I passed startTime and endTime - nothing
- I put admin's email and its client id instead of "all" - nothing
- I specified eventName as well - nothing
For every options above I get successfully created channel and the 'sync' state in the header (X-Goog-Resource-State). I repeat: i get the "sync" event as it's described in the documentation. Then I remove users from groups and add users to groups in Admin Console (https://admin.google.com/ac/groups) and do the same things in Groups (https://groups.google.com/my-groups). And even after several hours I don't receive any other events I see the events in Admin Console (Reporting -> Audit and investigation -> Admin/Groups log events) I can list these events in my code like:
var request = reportService.Activities.List("all", ActivitiesResource.ListRequest.ApplicationNameEnum.Groups);
var response = await request .ExecuteAsync();
They are existing. But I don't receive notifications but the 'sync'.
What's going on?