You live in Lyon and you really like skiing or snowboarding but you don't want to check everyday for the weather forecast ?
You like off-piste skiing and you want some fresh powder ?
You want to discover a new ski resort or keep exploring the same one ?
Users just need to subscribe by giving their mail adress.
Then by selecting one or several ski resort they can receive an email or a text message when it's snowing in the ski resort(s) they are interested in.
For this case we chose the last option, that is to say SMS but you can do the same with en email.
Users receive a text message everytime it is snowing in their favorite ski resort(s).
Such an alert in the afternoon or the evening means that there will be fresh powder the day after they receive the message.
Here we want to create an API.But what is an API ?
Basically, it is an interface that allows you to connect web services together.
To do so we will use IFTTT : If This Then That. This free service enables us to create applets that connect APIs together.
Firts things first create an IFTTT account on their website
As the names suggests IFTTT create a chain reaction.
The chain reaction we want to create here is the following one:
It is snowing The user receives a SMS to warn him that there will be fresh snow the next day.
We now have to create an applet that will create the chain reaction.
In order to do so, follow the instructions as shown in the images below.
First create an applet connecting Weather Uniform to Webhooks as shown in the picture on the left.
Then create another applet connecting Webhooks to SMS as shown in the picture on the right.
Here Webhooks allows us to use some data from collect through our website.
Now you can create a subscribe button on your website for instance. You then give the opportunity to users to complete the required infortmation to offer a better service.
This way the user can select several ski resorts.
The image below contains a part of the code you could write.
If you're looking for more explanations here are some useful resources:
- To know more about APIs
- To get more detailed information about IFTTT
- To watch one of the best ski movies ever (just for pleasure)