Forum Discussion
A web API key can only be specified when a web API key name is provided.
Hi akashgera ,
I studied the values that you're passing in the body and they don't look right to me. Also, I don't think that you can pass nested JSON objects via the Text.ToBinary-function.
Instead, you should use the Json.FromValue function with a proper record like so:
...
RequestBody=
[
skuCodes = { },
fromDate = "18/06/2021 15:40:30",
toDate = "23/06/2021 15:40:30",
pageNumber = 1,
dropShipFlag = "no",
locCode = ""
]
webdata = Web.Contents(url, [Content = Json.FromValue(RequestBody), Headers=header]),
...
As you can see, the M language in Power Query uses the opposite characters to define lists/arrays and records compared to JSON:
{ } defines an empty list/array and [ ] a record.
Hi ImkeF
I need your help in executing the below query which will generate the access token using power query.
After executing the above query it throws as error: webcontents failed to get contents from the given URL
Doing the same in Postman and giving the proper response, check the screenshot below
Pls help!!
- ImkeF5 years agoCommunity Champion
Hi akashgera ,
to troubleshoot I'd recommend to:
- record the web traffic that is generated by the Postman call and the call via Power BI Desktop. (I always use Fiddler for this task, but there are other optionas as well)- analyse the differences. Maybe it's due to the headers?
- to troubleshoot problems when refreshing in the service, read this:http://blog.datainspirations.com/2018/02/17/dynamic-web-contents-and-power-bi-refresh-errors/
- akashgera5 years agoHelper I
Thanks for the response, I am not much familiar with fiddler but after checking with fiddler, it is showing result-200, Response Header: HTTP/1.1 200 Connection Established