我正在尝试实施ERP系统和Google My Business之间的集成,以使商店数据保持同步 .
我在开发者控制台中有一个项目 . 我已获得使用GMB API的权限,并已获得Google批准使用此API .
我正在使用serviceaccount并遵循各种指南中的说明 .
但是现在我被卡住了 .
我正在使用谷歌GMB c#库连接到GMB . 我的服务帐户有一个有效的.12文件 .
string MybusinessServiceScope = "https://www.googleapis.com/auth/plus.business.manage";
String serviceAccountEmail = "myserviceaccount@myapplication-1349.iam.gserviceaccount.com";
var certificate = new X509Certificate2(_serviceP12File, "notasecret", X509KeyStorageFlags.Exportable);
ServiceAccountCredential credential = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(serviceAccountEmail)
{
Scopes = new[] { MybusinessServiceScope },
}.FromCertificate(certificate));
return new MybusinessService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "myapplication-1349",
});
当我尝试列出,修补或创建位置时,我会得到相同的响应:
找不到请求的实体 . [404]
Errors [
Message[Requested entity was not found.] Location[ - ] Reason[notFound] Domain[global]
]
任何帮助表示赞赏
1 回答
我无法使用服务帐户进行此操作 . 在与谷歌支持部门讨论此事后,我改为使用OAuth应用程序流程 .
这有效 .
我和谷歌聊天:https://www.en.advertisercommunity.com/t5/Google-My-Business-API/Unable-to-PATCH-location-with-v3/td-p/579536#
希望这可以帮助别人