Forum Discussion
JBBaxter
7 years agoFrequent Visitor
Call Google Search Console API with Power Query (M) - Web.Contents( POST Problem)
Hi Guys, i managed to work with googles oath2 in including a refresh of the access_token in Power Query (M), (what a pain to get the first token and the refresh token) made also my first requests...
v-yuta-msft
7 years agoCommunity Support
JBBaxter ,
This issue should be caused by invalid format of the query in body. How about use format like YYYY/MM/DD?
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- JBBaxter7 years agoFrequent Visitor
Thanks for your reply, v-yuta-msft
I tested it:
let body = "{ ""startDate"": ""2019/01/01"", ""endDate"": ""2019/02/01"" }", AccessTokenList = List.Buffer(api_token), access_token = AccessTokenList{0}, AuthKey = "Bearer " & access_token, url = "https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Fwww.xxxxxxx.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 JsonResponseStill gives me a 400
any other ideas? maybe (WebMethod.Post or WebAction.Request)?
Thx