我使用Business Profile Performance API来获取用于在搜索或Map中查找企业的搜索关键字。假设business_profile_performance是BusinessProfilePerformance
API类型的初始化变量,它也负责凭据:
try{
BusinessProfilePerformance.Locations.Searchkeywords.Impressions.Monthly.List impressionsList= business_profile_performance.
locations().searchkeywords().impressions().monthly().list("locations/"+locationName);
ListSearchKeywordImpressionsMonthlyResponse response = impressionsList.execute();
List<SearchKeywordCount> impressions = response.getSearchKeywordsCounts();
System.out.println("Size is "+ impressions.size());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
它给了我错误:
{
"code" : 400,
"details" : [ {
"@type" : "type.googleapis.com/google.rpc.BadRequest"
} ],
"errors" : [ {
"domain" : "global",
"message" : "Request contains an invalid argument.",
"reason" : "badRequest"
} ],
"message" : "Request contains an invalid argument.",
"status" : "INVALID_ARGUMENT"
}
任何帮助都将不胜感激。谢谢。
1条答案
按热度按时间taor4pac1#
好的我找到答案了,我没有发送月份范围: