05-11-2020 00:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-11-2020 00:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm trying to send my data to my server websocket in node js, but I don't understand how API messagin works, I can connect my phone with my laptop with socket in python, but I'd like a explication for example where the Ionic device sends the data, if it doesn't specify for example de ip or localhost where I want to send my data.
I hope to be clear and your help!
thanks.
05-11-2020 00:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


05-11-2020 00:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
The messaging API can only send data between the watch and clockface/app companion code within the Fitbit app on your phone. It can't send data to any other program or device.
If you want to get data outside of the Fitbit system, you have to use fetch() or WebSocket in your companion code.
This may help.
Gondwana Software
05-11-2020 18:18 - edited 05-11-2020 18:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-11-2020 18:18 - edited 05-11-2020 18:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks for the answer, I'm new in this topic, the development in your products is amazing and I want to improve, how I said, I'd like to obtain the data from the Ionic device, I've been searching and learning information about websockets and fetch; if I create a server websocket with python, the server should receive the information sent the websocket client in the Ionic device?

05-11-2020 18:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


05-11-2020 18:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I think you're close.
The Ionic can't send WebSocket messages, but the companion can. Therefore, you'll need to use some other way to get your data from watch to companion (ie, Fitbit's file transfer or messaging APIs).
If your python server is running on the same device as the Fitbit app (ie, probably your phone), then you won't need https if your phone can be addressed using one of the IPs listed in the link I gave before. For me, 127.0.0.1 worked as localhost.
If your python server is running on a different device (even if it's still on your LAN), you'll need to use https and a non-self-signed certificate.
Gondwana Software

05-15-2020 21:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-15-2020 21:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

