Hi everyone.
i have made this Json Script for gettin data by a Web API.
and i get this error:
DataSource.Error: The request was aborted: The operation has timed out.
Details:
http://energycloud-api.econgrid.com/1.0/ControllerUnits/26/StoredData?startDate=2018-02-10T00:00:00Z&endDate=2018-02-10T02:00:00Z&resolution=Hour&logParameterIds=1255&aggregateMethods=Avg
My Json script is look like this:
let
apiUrl = "http://energycloud-api.econgrid.com/1.0/",
controllerUnitId = "26",
/*
// Login to API
PostLogin = "{""username"":""XXXX"",""password"":""XXXX""}",
LoginResponse = Json.Document(Web.Contents(apiUrl & "Login", [
Content=Text.ToBinary(PostLogin),
Headers=[#"Content-Type"="application/json"]
])),
// Retrieve auth bearer token from response
AccessToken = LoginResponse[accessToken],
*/
AccessTokenHeader = "bearer XXXX",
// Send get data request to API
GetData = Json.Document(Web.Contents(apiUrl & "ControllerUnits/" & controllerUnitId & "/StoredData?startDate=2018-02-10T00:00:00Z&endDate=2018-02-10T02:00:00Z&resolution=Hour&logParameterIds=1255&aggregateMethods=Avg" , [
Headers=[
#"Authorization"=AccessTokenHeader,
#"Content-Type"="application/json",
#"Accept"="application/json"
]
]))
in
GetData
The web Service center for the API sees that we are post for data and they are sending there data, but we are just not reciving.
Is there any one can tell me what im missing or what PowerBi need to get ín the script ?
BR
/ Mike