I wrote a smartapp with an endpoint which I’m trying to invoke via IFTTT Maker channel. I’m struggling with constructing URL which Maker could call with consistent success.
Documentation says OAuth is required, but it’s a separate request to get token and it expires in 24 hrs. And Maker only allows 1 call, unless I missed something.
Is there a way to construct a permanent URL which would be good for external calls indefinitely?
Thanks!
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
2
Where you get {app id} from ____ page in IDE and you get {access token} from ___ place in the IDE.
Thanks!
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
4
Easy.
Publish the SmartApp “for me”.
Install it using SmartThings Mobile App using Marketplace (star tab), SmartApps, + My Apps.
Login to the IDE and look under Locations, SmartApps.
Click on the installed SmartApp instance and its AppID will be the long UUID unlabeled in the very bottom left corner, and the Access Token will be in the list of State variables (if you created one in your installed() method by calling createAccessToken()).
Or you could use a dynamic preference page to output the app.id and state.access_token.
Now I got wondering what you meant by “for now, you still can”. Is this yet another feature which Smartthings is going to take away from us?
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
6
The use of access_token in a URL is not recommended except in a secure server process (i.e., It was intended for callbacks to SmartThings for cloud-to-cloud REST-API based devices).
Your IFTTT example is testing the limits of the intended use case. The access_token is long lived and considered should be considered extremely confidential; the OAuth2 standard recommends making it very short-lived and using a “refresh token” & refresh process to change it frequently. A server can handle the refresh process easily and securely. IFTTT cannot.
Is there a “simple” complete example of using callbacks, the doc’s seemed kind of incomplete to me. Need something for my Arduino device to notify hub of new data. Thanks!
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
8
Hmmm…
I’d have to search the Forum and the GitHub archives; but, yes, it ought to be simpler.
My #1 suggestion: Lookup the recent ESP2866 (? – doh… I can’t even remember the chip number!) as what probably is an excellent example.
I’m presuming you are using LAN or WiFi with the Arduino, not the ThingShield (ZigBee based)?