Webmasters API User does not have sufficient permission for site

纵然是瞬间 提交于 2019-12-10 15:08:48

问题


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.


回答1:


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

whatever@developer.gserviceaccount.com

there.



来源:https://stackoverflow.com/questions/28080416/webmasters-api-user-does-not-have-sufficient-permission-for-site

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!