Forum Discussion
Pushing data to PowerBI Streaming dataset API fails when historic data analysis is ON
- 9 years ago
What is the JSON format in your case?
In my test, before enabling "HISTORIC" I can upload data with{ "DATETM" :"2017-03-02T09:04:48.837Z", "SALES" :5000000 }However after enabling "HISTORIC", I got a 400 error though the upload data would finally get saved as in your case. The reponse contains the the error saying something wrong with the dataset JSON. In case you have interest, the tool is POSTMAN.
Based on my test, with a dataset JSON format as below could always work either the "HISTORIC" is enabled or disabled.
[ { "DATETM" :"2017-03-02T10:04:48.837Z", "SALES" :45000000 } ]You can actually send multiple data in JSON array.
[ { "DATETM" :"2017-03-02T10:04:48.837Z", "SALES" :45000000 }, { "DATETM" :"2017-03-01T09:04:48.837Z", "SALES" :38000000 } ]
What is the JSON format in your case?
In my test, before enabling "HISTORIC" I can upload data with
{
"DATETM" :"2017-03-02T09:04:48.837Z",
"SALES" :5000000
}
However after enabling "HISTORIC", I got a 400 error though the upload data would finally get saved as in your case. The reponse contains the the error saying something wrong with the dataset JSON. In case you have interest, the tool is POSTMAN.
Based on my test, with a dataset JSON format as below could always work either the "HISTORIC" is enabled or disabled.
[
{
"DATETM" :"2017-03-02T10:04:48.837Z",
"SALES" :45000000
}
]
You can actually send multiple data in JSON array.
[
{
"DATETM" :"2017-03-02T10:04:48.837Z",
"SALES" :45000000
},
{
"DATETM" :"2017-03-01T09:04:48.837Z",
"SALES" :38000000
}
]
Thank you for your tests and input.
I supplied the data I am sending in the error quote (see original question at top of the thread):
Making POST request with data: {"timestamp":"2017-02-28T14:48:09.058","queuelength":75.0,"corridoroccupancy":8.0,"maxcorridor":10.0}As you can see my JSON isn't sent as an array (doesn't have the [ ] around it).
I will try to add that, and see what happens.
- Eric_Zhang9 years agoMicrosoft Employee
Based on my test, when "HISTORIC" enabled, no matter an array or not, it has to be wrapped with [].
- Prefsmaster9 years agoRegular Visitor
That did the trick!
Thanks a lot. It would make more sense if the error also appears when HISTORIC is OFF though :-)
Or clearly explain in the documentation and examples what should be sent...
- Eric_Zhang9 years agoMicrosoft Employee
It is great to hear that your issue has gone. If no further questions, could you please close accept a solution to close this thread?
Meanwhile, to reduce confusion, I've already escalated this behavior to the Product team.
- Eric_Zhang9 years agoMicrosoft Employee
- Anonymous7 years agoNot applicable
Man, what a save your post was to me today!! Need to perform demo's on an event tomorrow and couldn't get the historical analysis working from Python untill I saw your post. Thanks.