Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How does messaging API work?

 

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.

Best Answer
0 Votes
4 REPLIES 4

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.

Peter McLennan
Gondwana Software
Best Answer

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?

 

 

Best Answer
0 Votes

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.

Peter McLennan
Gondwana Software
Best Answer
0 Votes
Thanks a lot, I can do it!
Best Answer
0 Votes