Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
IO-TammiB
New Member

undefinedWeb.Contents with a Post to ecomdash.com

I'm attempting to pull data from the ecomdash.comAPI.  I can successfully pull the inventory and other items that are a straight GET.

To get the Order Details, I need to use a POST.  

 

Here is my current code:

let
url = "https://ecomdash.azure-api.net/api",
Path = "orders/getOrder",
Headers=[#"ecd-Subscription-Key"="999999", #"Ocp-Apim-Subscription-Key"="78eec1864fbc46cba0209cc7efaf8bd0", ContentType="application/json"],
Body = "{""OrderId"": 25243048}",

JsonResponse = Web.Contents(
url,
[RelativePath = Path,
Headers = Headers,
Content = Text.ToBinary(Body)]
),
Result = Json.Document(JsonResponse)

in
Result

 

I get this result,

DataSource.Error: Web.Contents failed to get contents from 'https://ecomdash.azure-api.net/api/orders/getOrder' (503): System Maintenance
Details:
DataSourceKind=Web
DataSourcePath=https://ecomdash.azure-api.net/api/orders/getOrder
Url=https://ecomdash.azure-api.net/api/orders/getOrder

Any help would be greatly appreciated.

 

The below screenshot displays the results from the interactive API as an example.

Request URL

https://ecomdash.azure-api.net/api/orders/getOrder

HTTP request

POST https://ecomdash.azure-api.net/api/orders/getOrder HTTP/1.1
Host: ecomdash.azure-api.net
ecd-subscription-key: 8888-88888-8888
Content-Type: application/json
Ocp-Apim-Subscription-Key: ••••••••••••••••••••••••••••••••

{
  "OrderId": 252430848
}
1 REPLY 1
lbendlin
Super User
Super User

Are you sure the order number should be sent as a number rather than a text?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors