API Project : IFTT & Applet


How does IFTTT works?

IFTTT (If This Then That) is a free web-based service to create chains of simple conditional statements, called Applets.

For example, an Applet can send an email if a user tweets about a predefined hashtag, or copy a photo on Facebook to a user's archive if someone identifies the user on the picture, etc...


Why is it interesting?

Because we can do hard coding process without coding!

Indeed, all API calls are etablished via IFTTT's interface, all we have to do is connecting them together. Thus, thanks to this interface really easy to understand, we can create an Applet (which otherwise would have taken a lot of hours to set up).

How do we proceed?

First, if you have any questions or if you want to learn more about IFTTT, I invit you to visit their documentation page. It is very complete and it will help you understand how to proceed if you want to go further.

Now, I want to show you how to create an Applet that could be used often. I will explain the process step by step :


Step 1 : Setting up

After register in IFTTT, click on your profile and click on 'Create'. When you are here, you arrive on a page with written 'If Then This That' : this is where we will deal with every part of our Applet. In fact, this is through this interface that we will decide what we are going to do.


Step 2 : Choose the trigger

The trigger is the start of everything, our applet is simply useless without it. Click on 'This' to select one, then in the search bar click on 'Connect Button widget'. As you can read on it, it will create an icon which you can put on your smartphone's homescreen, and it will execute the action we want just by clicking on it. :)

For the two nexts windows you only have one action available so just click on them to continue.


Step 3 : Choose the action

Now that our trigger is set, we have to define what we want it to execute, what happens when we will press this icone?... Well once again you have a looooot of possibilities.

Here let's build a security Applet, imagine you are in danger (of course I hope you will not have to use it one day!) and you want to quickly send a message with your position to someone, well that is what we will be doing.
To do so : click on 'Then That' and search for Android SMS.
Now, you just have to fill in the fields as you want, ingredients are variables given by your device that are really helpful. In our context it will allow us to send a message to the person we want and give him/her our exact position, as you can see on the screenshot below.

Conclusion

Nowadays, it is really easy to create an Applet to do a simple (or complex) task that would have cost you more time and money if you didn't know how to code. You can easily do almost anything you want and that is why APIs are so useful and more and more used. You just need some ideas and you can make it happen in a really short period.