我通过 Power-Query(M) 调用了 google.webmasters.api 并设法配置了 oath2 并成功调用了 get & list。现在我尝试调用 /searchAnalytics/query? 这仅适用于 Post。这总是以 400 错误响应。查询或 URL 的格式无法正常工作。
这里有一些额外的信息:
格式日期不同:
body = "{ ""startDate"": ""2019-01-01"", ""endDate"": ""2019-02-02"" }",
至
body = "{ ""startDate"": ""2019/01/01"", ""endDate"": ""2019/02/02"" }",
let
body = "{ ""startDate"": ""2019-01-01"", ""endDate"": ""2019-02-02"" }",
AccessTokenList = List.Buffer(api_token),
access_token = AccessTokenList{0},
AuthKey = "Bearer " & access_token,
url = "https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Fxxxxxxxxx.xxx/searchAnalytics/query?",
Response = Web.Contents(url, [Headers=[Authorization=AuthKey, ContentType="application/json", Accept="application/json"], Content=Text.ToBinary(body) ]),
JsonResponse = Json.Document(Response)
in
Response
获得 400 并在 Gooogle-Api 概述中显示为 400 调用
任何想法有什么问题?
谢谢