GMB API - 无法 Get/Updated Google 企业帐户 Pub/Sub 通知设置

GMB API - Unable to Get/Updated Google Business Account Pub/Sub Notification Settings

我正在尝试使用 Google 我的业务 API C# 客户端库:https://developers.google.com/my-business/samples/ in order to get real-time notifications for Location and Reviews. I have followed the steps provided at: https://developers.google.com/my-business/content/notification-setup#get_started。但是我卡在了 point 5) Account.updateNotifications.

我收到此错误:"{\"name\" 的参数验证失败}"

我能够使用相同的 "name" 参数成功获取帐户、位置、评论等,但它不适用于通知。我附上下面的代码。

GMBServiceInit();
string name = "accounts/1234567890132456"
var notification = new Notifications
{
    TopicName = "projects/gmbproject/topics/notification_topic",
    NotificationTypes = new List<string>
    {
        "NEW_REVIEW",
    }
};

//Get Notifications Settings
var response = await GMBService.Accounts.GetNotifications(name).ExecuteAsync();

//Update Notifications Settings
var updateNotificationRequest = GMBService.Accounts.UpdateNotifications(notification, name);
var updateNotificationReponse = await updateNotificationRequest.ExecuteAsync();

如果有人有这个问题,请帮我解决这个问题。谢谢!

找到解决方案。

我使用的名字是:

string name = "accounts/1234567890132456"

我应该使用:

string name = "accounts/1234567890132456/notifications"