Search code examples
cloudhealth-monitoring

Don’t get any measuring data from iHealth cloud (sandbox)


I write an application that uses the API of iHealth. Scales, blood pressure monitor, and devices like that by iHealth send there data with Bluetooth and smartphone apps to the internet cloud of iHealth. Therefore a user of this devices has a user account in the iHealth internet cloud. There he can login and see his data. My app uses the iHealth API to get the data from this cloud. The user of the devices gives mi the right to access his data by OAuth 2 and after receiving the access data I ask for the data of the user with the given client id.

Well, here comes the problem. As a result I get a JSON-Object of measuring data without any data. That means there is no error message, everything seems fine, except that there are no data of this user. It's no kind of error documented here:

sandbox.ihealthlabs.com/dev_documentation_ResponseFormatAndErrors.htm

Http status is good too (200).

I don't use any optional restrictions like asking for data of only certain time.

An explication would be that the user still hasn't used his devices and the cloud therefore doesn't has any data. Unfortunately this is something I can't influence: My app is still not ready and therefore I only use the sandbox cloud offered for development (http://sandbox.ihealthlabs.com).

The sandboxuser can't use the smartphone apps and therefore I can only read the data that are yet there in the cloud. Of course I can't test without data. Who could develop without receiving data? There has to be an error. Maybe a rather silly error. I asked more than 9 days ago the support but still haven't got any answer.

Getting JSON data from the cloud with the API for blood pressure (openApiBP) (the XX-parts are abbreviated id, token, ...):

http://sandboxapi.ihealthlabs.com/openapiv2/user/d7XX..XX9f/bp.json/?client_id=a6XX..XXbe&client_secret=2bXX..XX3f&redirect_uri=http%3A%2F2Flocalhost%3A8082%2FTelemedicina%2Fdispositivos.html%3Fregreso%3DiHealth&access_token=u8XX..XXyw&sv=6cXX..XXcf&sc=deXX..XXcf

The answer to this (without any change) is just:

{"BPDataList":[],
"BPUnit":0,
"CurrentRecordCount":0,
"NextPageUrl":"",
"PageLength":50,
"PageNumber":1,
"PrevPageUrl":"",
"RecordCount":0}

Using the API for Weight (OpenApiWeight) has the same problem as the OpenApiBP. I have read the documentation more than once and searched for an explanation in the web. As you see I ask the API and get this maybe correct but useless answer for development purposes. Any idea? What do I miss?


Update: An iHealth Lab tecnican answered me. In the sandbox is just now user data. My way of asking and the recifed answer are therefore correct. It's not an error. To get data the application has to be registered for the real world. He didn't explain how to test with this limitation of the sandbox.


Solution

  • I let the the answer of the iHealth Lab api technician speak for itself:

    "The sandbox does not provide any actual user data. If you want actual live data you will have to register a new application at developer.ihealthlabs.com."

    If this is the answer to my question of why not reciving any data means there is really no data that I could recive. Thanks to all that tried to help me, especially Scott Lawson. I hope this answer will help others. Knowing this a few days ago would have saved me a lot of time.