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.
Hi everyone.
I'm having big problems retreving some data from an restfull api.
APi documentation example looks like this.
Product
This endpoints allows retrieveal, creation, modification and deletion of products in Warehouze, it also allows retrieval of stock quantities pr. warehouse.
Call requires at least one property name, blank query is allowed.
AdjustedInStockQty | Decimal | False | |
Barcode | String | True | |
Barred | Boolean | True | |
BaseNumber | String | False | |
ColliQty | Decimal | False | |
CompanyId | Int32 | False | |
CreationDate | DateTime | False | |
CustomProductPropertyFive | String | False | |
CustomProductPropertyFour | String | False | |
CustomProductPropertyOne | String | False | |
CustomProductPropertyThree | String | False | |
CustomProductPropertyTwo | String | False | |
DataSource | DataSource | 0 Economic, 1 SmartWeb, 2 Local, 3 Magento, 4 GoldenPlanet, 5 Shopify, 6 WooCommerce, 7 FakturaFil, 8 IEX | False |
DeliveryDays | Int32 | True | |
ExtraCosts | Decimal | False | |
GroupId | Int32 | False | |
Height | Decimal | False | |
Id | Int32 | False | |
IncludeInShoppinglist | Boolean | False | |
IsCollectionMaster | Boolean | False | |
IsMaster | Boolean | False | |
LastUpdated | DateTime | False | |
Length | Decimal | False | |
LocationId | Int32 | False | |
Name | String | True | |
Notes | String | True | |
Notifications | String | False | |
Number | String | False | |
OrderedByCustomersQty | Decimal | False | |
OrderedFromSuppliersQty | Decimal | False | |
PoQtyMin | Decimal | False | |
SelectedVariantType1 | String | False | |
SelectedVariantType2 | String | False | |
ShippingMethod | String | False | |
ShippingPrice | Decimal | False | |
ShoppingQty | Decimal | False | |
StockQty | Decimal | False | |
SupplierId | Int32 | True | |
SupplierProductNumber | String | True | |
TurnoverQty | Decimal | False | |
UnitCostPrice | Decimal | False | |
UnitId | Int32 | False | |
UnitPrice | Decimal | False | |
UnitSalesPrice | Decimal | False | |
VariantMasterId | Int32 | False | |
Volume | Decimal | False | |
WarehouseId | Int32 | False | |
Weight | Decimal | False | |
Width | Decimal | False |
var request = { Token: "Insert your token here", Query: [ "Number=130", "WarehouseNumber=1", ], Properties: [ "Id", "Name", "StockQty", ], }; $.ajax({ url: "https://api.warehouze.io/Product", data: request, dataType: 'text', type: "GET", traditional: true, success: function (data) { console.log(data); }, error: function (data, xHr) { console.log(data); console.log(xHr); } });
Can anyone help me how to extract data?
You can't have a GET request with a payload in Power BI (or anywhere, I think). It has to be a POST request.
Power BI does all that automatically via Web.Contents and Json.FromValue
for example:
let
URL = "http://xxx/tstat",
headers = [#"Content-Type"="application/json"],
data = Json.FromValue([tmode = 2,t_cool = Setpoint,hold = 0]),
web = Web.Contents(URL, [ Content = data, Headers = headers, ManualStatusHandling = {404, 400}]),
result = Json.Document(web)
in result
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
53 | |
21 | |
12 | |
12 |