Forum Discussion

IO-TammiB's avatar
IO-TammiB
New Member
2 years ago

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

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