APICall

Hi geeks ;o)

  {API}Call is a widget for Garmin devices for calling HTTP URLs. Typical usage is for calling REST API of IOT devices or home automation boxes (Fibaro, eedomus, jeedom, zipa, vera ...) or others things via ifttt.com. It's wanted to be very versatile to be used with lots of applications/situations, like open the gate when get back from a run, close shutters from your couch ... or help a guy who has epilepsy to log partial seizures using IFTTT webhooks (it's not a joke I received a mail to thanks for the widget with this story).

I did it initially for my personnal use, and I'm very happy to share it for everyone. More, it's free, so please be kind and clement ;o).

https://apps.garmin.com/en-EN/apps/ac9a81ab-a52d-41b3-8c14-940a9de37544

To be honest the configuration is not so easy but it's the counterpart of the versatility and of the number of available options.

The page of the app describes the majority of options, but you can find the complete guide here : https://apicall.dumesnil.net/

The first version was released 2 years ago I think the widget is now quite accomplished, but it's there always things to improve, so don't hesitate to suggest me something that is missing.

  • Hi all,

    I work actually on the widget to send the request directly via WiFi or LTE.

    I got a beta version that is working properly. I still have some displaying bugs, but I'm wondering the best way to add this option.

    Because when the request is launched via WiFi it make several more time, I don't want to do the request every time, so I hesitate between :

    • add an option in the json field "wifi-lte:true", as it, it's just a simple option to make the request via Wifi for the action. As it you just have to duplicate the entry (1 with BT, 1 other via WIFI or LTE) if you want have different behavior.
    • add a global option to do say something lile "if BT is not connected, try with WiFi/LTE", it's global to all actions.
    • via an option in the json, set the preference by action like "media:[BT | WIFI | BT->WIFI | WIFI->BT]"
  • That would be awesome! I think I would like the last option most: being able to specify a preference for each action separately and also the order in which it tries to establish a connection.

    Also, it would be very nice if it was possible to send http requests in the local network without encryption (no https). Not sure if you have any influence on that, though.

    Let me know if you need any help.

  • Hi,

    I pushed the new release some days ago. I finally choosed the second option, which is better for memory usage and seems to be OK for most cases.

    For http, I didn't test it but it could work with wifi. But with BT is not possible, due to restriction of GarminConnect app related to best practices recommended by Apple and Android dev.

    Regards. 

  • I've tried it out, it works. Great job!

    Even http requests are working via wifi, no enforcement of https (at least in my local network). Unfortunately, now I have to turn off Bluetooth on my phone before I can send a http request with my watch, as it always tries to use the Bluetooth connection first which still requires https...

    Could you add an option to disable Bluetooth completely? Or let the user choose per action, what was your first proposal? That would help me a lot (and I think other users as well, I saw quite a few complaints about the https limitation in the app ratings).

    I would definitely spend a beer for that ;-)

  • Hi, OK I will take a look to add an option "media", which will take 2 values :

    • BT : try only BT
    • WIFI-LTE : try only WIFI/LTE

    If not defined, it will use default behavior (BT if connection available, then WIFI if the general option is not disabled).

    But, keep in mind that HTTPS is available on many solutions. And if not available, you can use some generic proxy (ifttt) or do something by yourself on your LAN as a little HTTPS proxy with a http server and a simple php page.

    Could you send me an email to garmin @ dumesnil.net. When I will check if it is acceptable regarding the memory cost, I will let you know. 

  • Sounds great, thank you so much! I've sent you a mail.

  • It seems like when you configure your action to take WIFI-LTE as default that first the WIFI Connection needs to setup before the action will be executed.  It will close the connection afterwards.

    Is it possible to make the wifi connection on startup of the application and keep it active till the application will be closed?

  • Hi,

    As far as I know, it's not possible. The SDK provide a method to "make a request", that hide the connection processing ...

    In other words, in my code, I call makeWebRequest(). I don't "open_wifi_cnnection" then "launch_the_request()" 

    Regards.

  • Thank you for your fast answer,  no problem your application works great!  Thank you!  Do you know if there are tutorials available for garmin application development.

    Thank you!

  • Do you know if there are tutorials available for garmin application development.

    https://developer.garmin.com/connect-iq/monkey-c/