Looking closer at the sample code here (2 methods described) …
You can do the GET and expect back a “200” from ifttt.
I think ifttt sends back a status code of ‘200’ if received successfully.
(that’s pretty much standard for most API’s).
Now, there are two methods…
- The imp will do the GET and go on with whatever it is doing.
It will process the status 200 when it arrives.
- The imp will do the GET and simply stop until it gets the status 200 from ifttt.
I think you want to do the asynchronous (no. 1) method.
Do the GET and move on with your imp stuff.
When ifttt reports back a 200 (and only if it is a status 200), then log it, or process it as successful.
That “if” statement will execute when the status comes back, even if the imp has moved on to something else.
I believe that ifttt is sometimes lazy or delayed in sending back status. By that I mean 2-6 seconds?
I’ve only used ifttt in the other direction, where ifttt posts to my imp. Doing it your way, where the imp sends to ifttt … I send imp data to my website (PHP scripting to a database). So I cannot attest for how timely ifttt operates.
(and when I keep saying “imp”, I mean the ‘agent’ and the ‘device’ as a whole. The agent is actually what is talking to ifttt).