Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this be used for health (Mi Fitness) API? #14

Open
ghost opened this issue Dec 26, 2022 · 0 comments
Open

Can this be used for health (Mi Fitness) API? #14

ghost opened this issue Dec 26, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented Dec 26, 2022

I'm trying to use the API at hlth.io.mi.com. I can successfully log in and view my device list, but trying to make requests to the health API (for example https://hlth.io.mi.com/app/v1/data/get_fitness_data_by_watermark) return 401 {"code":2,"message":"auth err"}.

Here's what I've been able to figure out so far:

  • This is a separate error from an incorrect token altogether; that would return 401 with inner code 0.
  • micloud library logs in with user-agent containing APP/xiaomi.smarthome, while the Mi Fitness app on my phone logs in with APP/xiaomi.wearable.
  • Similarly, micloud library uses a sid of xiaomiio, while Mi Fitness app uses miothealth.
  • Trying to change either of the above results in a "captcha required" error on login step 1.

I'm way out of my depth here. Are you by any chance able to help figure out why this is happening? I'm happy to share (in private) network logs from the app on my phone, including login flow.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants