[英]How do I access Google API methods that include siteURL with the ruby client?
I'm trying to access the Google Webmaster Tools API with the ruby client: 我正在尝试使用ruby客户端访问Google Webmaster Tools API:
webmaster_tools_api = client.discovered_api('webmasters', 'v3')
result = client.execute(
:api_method => webmaster_tools_api.sites.example.com.urlCrawlErrorsCounts.query,
)
The API method I am trying to access uses the siteurl in the method name. 我尝试访问的API方法使用方法名称中的siteurl。 This won't work because the syntax conflicts. 由于语法冲突,因此无法使用。
Is there a way to access API method names that include URLs? 有没有办法访问包含URL的API方法名称?
results = client.execute(
api_method: webmaster_tools_api.urlcrawlerrorscounts.query,
parameters: { 'siteUrl' => 'example.com' }
)
(Google's API docs are terrible so it's not surprising you couldn't find this.) (Google的API文档非常糟糕,因此找不到它也就不足为奇了。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.