Is there a simple example of a sync app?

I am new to the Connect IQ SDK and would like to create an application that synchronizes the recorded FIT files from an EDGE 530 (integrated WIFI) with my own web service via WIFI. Is there a simple example of how to do this?

Or is it possible to change the target URL for the synchronization so that I can rebuild GARMIN's WEB API on my own server?

  • Do you know how it works? I could only find the Health API request page (www.garmin.com/.../), which I don't need, as it provides access to the data of all users, which is e.g. used by Strava and which is of course not available to everyone. There seems to be very little information out there regarding a Connect API.

  • That is the correct place.  The Health API request gives you access to the health data and the Connect sync/profile access.  The documentation is closely held and only provided to developers once their request has been reviewed and approved.

  • I had an e-mail conversation with the Garmin support:
    Seems Garmin is giving business customers access to all their user data, but if a private customer wants to access his own data, Garmin does not allow that.

  • Weird. I'm almost certain there was a presentation at the Developer Summit last year (maybe the year before) where it was announced that the Garmin Health API was being opened up for all developers.

    I think you're probably going at this from the wrong direction. It seems that you shouldn't want (or need) any code running on the device to get the workout into your web service. You should be trying to do the same thing that Strava does, which is to register a webapp with Garmin Connect to receive notifications when a registered user's activity is uploaded.

    https://support.strava.com/hc/en-us/articles/216918057-Garmin-and-Strava

  • "You should be trying to do the same thing that Strava does, which is to register a webapp with Garmin Connect to receive notifications when a registered user's activity is uploaded."

    That was exactly what I thought of after reading the first answers to my question. And this is what the Health API support team wrote to me:

    "Unfortunately, Health API is not available for private use. We are server to server communication only and require a company web site with privacy statement (to satisfy privacy laws) . 
    I wish our API would be more open, but we do not have plans to open so far."

    Garmin may also not have understood that I don't want to access other customers' data, but only my own data. Or their API does not support the case that someone only wants to access his own data.

  • The thing is, this kind of gives you "the keys to the kingdom", even if it's just for your own data.

  • The thing is, this kind of gives you "the keys to the kingdom", even if it's just for your own data.

    This statement is obviously wrong.
    It gives me access to all acounts whose username and password I know. And that's just my own. Building a REST API doesn't mean you have to give up authentication.

    And even now I can already access all accounts whose username and password I know. Just not via a REST API.

  • I would like to do something similar, create an app the syncs my watch with Garmin Connect servers twice a day.

    The sync can be done in two ways:

    • Bluetooth connection to phone
    • Watch WiFi directly

    I currently sync my watch manually almost every day, turning on Bluetooth/Wifi, wait for the sync to finish and then turning Bluetooth/Wifi back off.

    So it'll be awesome if a background app can do that for me.

    `Communications.startSync()` is only a wrapper to a custom SyncDelegate, right? Or does it call the Garmin Connect servers somehow?

    What do you think @jim_m_58, is such a thing possible?

    Thanks.

  • Not tried it, but if you have wifi off in the FW, I can't see how you can turn it on with CIQ.  Same wit BT.

  • The stock Sync Control already does turn on Bluetooth if it's off, in order to sync.

    https://www8.garmin.com/manuals/webhelp/fenix6-6ssport/EN-US/GUID-0DC94101-1486-420B-8EA5-EFF3B32C3B0D.html

    And BT can be turned from CIQ on with ` Ble.setScanState(Ble.SCAN_STATE_SCANNING);`, right?