Google Webmasters API for Java returns empty site list

落花浮王杯 提交于 2019-12-04 03:53:47

After some debugging of Google's Oauth authentication code, a colleague of mine discovered that there was nothing wrong with my code but there is a certain procedure that should be followed at Google Webmasters Console which nowhere to mentioned by the way:

  • You have to give "full" permission to your service account email address for each of your domains. If you gave the "ownership" before, you have to revoke that ownership (because you can not modify the permission if you give ownership before giving permission).

  • You have to give ownership to your service account email address.

If you do this in the wrong order; your site will not be listed in sitemaps list and even if you explicitly try to get sitemaps of your site by it's address you will get an authentication error.

You have to give permissions and ownerships for each domain you would like to access (even just for getting their names).

There is no single top level access control for all your sites.

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