Our project !

Our project is very simple. We want to simplify your interaction with the music and spotify. It is so tiring to look for the new song that you just heard on spotify. However thanks to our API you will be able to add instantly to your Spotify's library any song that you heard. You just has to enter the name of the music and the artiste in our API and then the song will be added to your Spotify's Library !

What is an API ?

API is the acronym for Application Programming Interface, which is a software intermediary that allows two applications to talk to each other. Each time you use an app like Facebook, send an instant message, or check the weather on your phone, you’re using an API.

When you use an application on your mobile phone, the application connects to the Internet and sends data to a server. The server then retrieves that data, interprets it, performs the necessary actions and sends it back to your phone. The application then interprets that data and presents you with the information you wanted in a readable way. This is what an API is - all of this happens via API.

To explain this better, let us take a familiar example.

Imagine you’re sitting at a table in a restaurant with a menu of choices to order from. The kitchen is the part of the “system” that will prepare your order. What is missing is the critical link to communicate your order to the kitchen and deliver your food back to your table. That’s where the waiter or API comes in. The waiter is the messenger – or API – that takes your request or order and tells the kitchen – the system – what to do. Then the waiter delivers the response back to you; in this case, it is the food.

Here is a real-life API example. You may be familiar with the process of searching flights online. Just like the restaurant, you have a variety of options to choose from, including different cities, departure and return dates, and more. Let us imagine that you’re booking you are flight on an airline website. You choose a departure city and date, a return city and date, cabin class, as well as other variables. In order to book your flight, you interact with the airline’s website to access their database and see if any seats are available on those dates and what the costs might be.

However, what if you are not using the airline’s website––a channel that has direct access to the information? What if you are using an online travel service, such as Kayak or Expedia, which aggregates information from a number of airline databases?

The travel service, in this case, interacts with the airline’s API. The API is the interface that, like your helpful waiter, can be asked by that online travel service to get information from the airline’s database to book seats, baggage options, etc. The API then takes the airline’s response to your request and delivers it right back to the online travel service, which then shows you the most updated, relevant information.

To know more :
IFTTT Documentation
The Ultimate IFTTT Guide

How to do our API ?

Step 1 : Sign up or Sign in to IFTTT

Step 2 : Click on Create in order to create a new applet

Step 3 : Click on This and search for Webhooks

Step 4 : Click on the Webhooks icon and then click on Receive a Web request

Step 5 : Name your event "Spotify" and then click on Create trigger

Step 6 : Click on That and search for Spotify

Step 7 : Click on the Spotify logo and then click on Save a track

Step 8 : Click on add ingredient and do as on the picture below and finally click on Create action

Step 9 : Congratulation you have done it !



Get started !

In order for your song to be added to your Spotify library you have to make a post request.

POST https://maker.ifttt.com/trigger/inotify/with/key/{{key}}

body : { "Value1": "Title of the song", "Value2": "Name of the artist" }

The body of your request must contains two keys:

Value1 : which is the title of your song
Value2 : which is the name of the artist
This will trigger the API which will add the song to your Spotify's library.

Curl line to enter in the command center of your computer to trigger the webhook:

curl -d '{"Value1":"Song title", "Value2":"Name of the artist"}' -H "Content-Type: application/json" -X POST https://maker.ifttt.com/trigger/Spotify/with/key/{{key}}

How to get the key ?

You can get the key right There by clicking on documentation ! Then you can replace {{key}} by your real key.