Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi community,
I am trying to build a request in power query with this POST request
curl https://connect.squareup.com/v2/orders/search \ -X POST \ -H 'Square-Version: 2024-10-17' \ -H 'Authorization: Bearer xxxxxxxxxxxxx' \ -H 'Content-Type: application/json' \ -d '{ "location_ids": [ "xxxxxxxxxxx" ] }'
I am struggling to construct a proper query in ower Query. The following M code returns an error MSG DataSource.Error: Web.Contents failed to get contents from 'https://connect.squareup.com/v2/orders/search ' (400): Bad Request.
------------------------------------
let
url="https://connect.squareup.com/v2/orders/search",
body = "{ ""location_ids"": ""xxxxxxxxxxx""}",
parsed_json = Json.Document(body),
buildQueryString = Uri.BuildQueryString(parsed_json),
headers=[
Authorization="Bearer xxxxxxxxxxxxx",
#"Content-Type"="application/json"],
Source = Json.Document(Web.Contents(url,[Headers = headers, Content = Text.ToBinary(buildQueryString) ] ))
in
Source
-----------------------
Can anyone help me out?
Solved! Go to Solution.
Please follow the documentation. Use Json.FromValue. https://learn.microsoft.com/en-us/powerquery-m/web-contents#example-2
Please follow the documentation. Use Json.FromValue. https://learn.microsoft.com/en-us/powerquery-m/web-contents#example-2
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 7 | |
| 5 | |
| 5 |