【问题标题】:Google My Business API use of filter parameter is not clearGoogle My Business API 使用过滤器参数不清楚
【发布时间】:2019-12-05 18:09:08
【问题描述】:

我使用 GMB API 从我的 GMB 帐户中检索位置信息。如果我想选择所有位置没问题,但我无法使用过滤器参数选择相关子集。

检索我使用的所有位置时:

获取https://mybusiness.googlapis.com/v4/accounts/xxxx/locations

当我使用过滤时,我会这样做:

GET https://mybusiness.googlapis.com/v4/accounts/xxxx/locations?filter=%22storeCode='RT-1'%22
--> this still gives all results

GET https://mybusiness.googlapis.com/v4/accounts/xxxx/locations?filter=%22location.storeCode='RT-1'%22
--> this still gives all results 

GET https://mybusiness.googlapis.com/v4/accounts/xxxx/locations?filter=%22store_code='RT-1'%22
--> this still gives all results

GET https://mybusiness.googlapis.com/v4/accounts/xxxx/locations?filter=%22location.store_code='RT-1'%22
--> this still gives all results

GET https://mybusiness.googlapis.com/v4/accounts/xxxx/locations?filter=store_code=%22'RT-1'%22
--> gives no results, but also not an error message

GET https://mybusiness.googlapis.com/v4/accounts/xxxx/locations?filter=store_code=%22RT-1%22
--> gives no results, but also not an error message

GET https://mybusiness.googlapis.com/v4/accounts/xxxx/locations?filter=location.store_code=%22RT-1%22
--> gives no results, but also not an error message

GET https://mybusiness.googlapis.com/v4/accounts/xxxx/locations?filter=location.storeCode=%22RT-1%22
--> gives no results, but also not an error message

Could someone please point me a working solution?

I read through pages of documentation, but they give different stories. I also tried to filter with other attributes, but that appears not to be different. Next to that, the Google documentation states I can use all fields to filter.

To support my statements I used OAuth2 playground, so no programming issues. Authentication is not the problem since I can retrieve the complete list of locations.

Hope someone can help me! And if you also have an example of the 'orderBy' parameter that would be great!

Leon

【问题讨论】:

    标签: google-my-business-api


    【解决方案1】:

    我们一直在努力解决同样的问题,Google 的文档非常无助,因为他们自己的 storeCode 示例不起作用。

    实际上似乎起作用的是按 location_name/locationName 过滤并在那里轻弹您的商店代码(不要问我为什么,当然这没有任何意义)。

    所以你必须像这样调用 API:

    GET
    https://mybusiness.googlapis.com/v4/accounts/xxxx/locations?filter=location_name="RT-1"
    
    GET
    https://mybusiness.googlapis.com/v4/accounts/xxxx/locations?filter=locationName="RT-1"
    

    是否使用 upperCamelCase 似乎没有任何区别。

    最好的问候,马克

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-25
      • 1970-01-01
      • 2017-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-05
      • 2018-07-17
      相关资源
      最近更新 更多