问题描述
我使用google-api-php-client库访问网站管理员工具数据。当我想列出站点地图时,它出现致命错误:未捕获异常'Google_Service_Exception'(403)用户没有足够的站点许可权。另请参阅:。 '
我将服务帐户的电子邮件地址添加为我的网站的限制用户,但仍然存在错误。
最后我找到答案:
服务帐户不像普通的Google帐户。即使您向该特定地址访问该地址,也无法使用它访问特定资源。请参阅,了解您可以授权您向网站管理员API。
服务帐户不像普通的Google帐户。即使您将特定地址访问给它,也不能使用它访问特定资源。
您需要通过。添加您的服务帐户
$ b
那里。
I use google-api-php-client library to access webmaster tools data. When I wanted to list sitemaps, it appeared Fatal error: Uncaught exception 'Google_Service_Exception'(403) User does not have sufficient permission for site. See also: https://support.google.com/webmasters/answer/2451999.'I add the service account email address as a restrict user for my site, but error still exists.
Finally I find the answer:A service account is not like a regular Google account. You cannot use it to access specific resources even if you give that specific address "access" to it. See here for the different ways you can authorize your requests to the Webmaster API.
A service account is not like a regular Google account. You cannot use it to access specific resources even if you give that specific address "access" to it.
You need to manage the service permissions via Webmaster Admin. Add your service account
there.
这篇关于网站管理员API用户没有足够的网站权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!