Documentation

Introduction

The integration of your service will be represented on IFTTT as a service. In order to build the best possible service on IFTTT, we recommend you freshen up your IFTTT terminology.

Think of triggers as events on your service. Some example triggers are “Any new post” or “New photo added to album” or “Any new motion.”

Conversely, think of actions as sending data or creating resources on your service. Some example actions include “Create post” or “Upload photo” or “Turn on lights.”

Trigger fields allow for users to input filters or modifiers for a given trigger. For example, when a user selects the trigger “New photo added to album,” they will be prompted to input the album name.

The attributes emitted from a given trigger are called ingredients. For the trigger “New photo added to album,” there would be ingredients for “PhotoURL” and “TakenAt.”

When creating an Applet, a user assembles these ingredients in the action’s action fields. Action fields are like form fields. For the action “Create post,” there would be an action field for “Title” and another for “Post body.”

Timeline

Timeline

Overview

IFTTT defines a clear and concise protocol which your service’s API will implement. Each trigger and action for your service will map 1-to-1 to an API endpoint on your service built specifically for IFTTT. Trigger endpoints will be event streams that IFTTT will poll for new data. Conversely, action endpoints will be writable endpoints that IFTTT will send data to. For services that use OAuth, IFTTT is fully compatible with a couple of the common flavors of OAuth 2.0.

This document will guide you through the ideal workflow for swiftly adding your service to IFTTT.

1. Set up your environment

You will be creating IFTTT-specific endpoints that correspond to each trigger and action in your service.

If you already have an API that you would like to build on top of, there are a couple common strategies to add an IFTTT compatibility layer:

  • Deploy a “shim app” that sits between your API and IFTTT. This app will translate resources from your API into responses IFTTT can understand.
  • Add endpoints to your API service. These endpoints can source data from your existing API and serve them in responses IFTTT can understand.

If you do not have an API, IFTTT’s protocol will guide its development with its straightforward requirements.

In order to enable rapid iteration, you might consider using a tool like ngrok or Forward to forward IFTTT’s request to a local development environment while you are in the early stages of service development.

2. Create your service and connect to IFTTT

IFTTT provides a testing tool which you will be using soon to build out your endpoints. The first endpoint you’ll build is /status, which will help you verify IFTTT can reach your service.

Navigate to your service dashboard and create a new service. You can leave many of the details for later, but be sure to fill out the API URL Prefix.

Build the status endpoint. When it’s ready, navigate to the “Test” tab, and run the “Endpoint Test.” A passing status spec indicates that IFTTT was able to reach you!

3. Describe your triggers and actions

Fill out the details of your service, describing the triggers, their ingredients, and the actions.

While there’s a bit of art to choosing the right trigger and action functionality for your service, the following principles are quite helpful:

Start with a handful of the most obvious triggers and actions and expand later. Triggers like “Any new photo” or “New post by you” tend to get broader use than ones like “Any new photo with tag” or “New post by you in category.”

Less fields are better. Instead of one trigger “Ignition turned on or off” with a field for “On or off?”, it’s much more powerful to have two triggers: “Ignition turned on” and “Ignition turned off.”

Remember, you can easily make changes before launching–consider this first pass a rough draft. Your main goal is to communicate to IFTTT what resources you will need to implement.

4. Use IFTTT’s endpoint testing tool

IFTTT’s endpoint testing tool will enable you to rapidly develop your endpoints with the peace of mind that they are compatible with IFTTT.

The workflow of the testing tool is straightforward:

  1. IFTTT makes a request to {{api_url_prefix}}/ifttt/v1/test/setup
  2. This endpoint’s response provides a valid access token for a user (if applicable) as well as valid sample values for each trigger and action field in your service.
  3. IFTTT uses the access token (if applicable) and sample values to make test requests against your API.

You can find the endpoint testing tool under the “Test” tab on your service’s dashboard.

See our documentation for more details on setting up testing with your API.

Use this tool to build out the endpoints for your triggers and actions, referring to our protocol reference as needed.

5. Set up OAuth integration

IFTTT is fully compatible with a couple of the common flavors of OAuth 2.0. For more details on our implementation, see the connection section of our protocol reference.

When you’re ready, use the connection testing tool under the “Test” tab on your service’s dashboard to ensure the integration is working properly.

6. Implement the Realtime API

With IFTTT’s Realtime API, you can have recipes involving user-oriented triggers from your service run near-instantly.

See our documentation for instructions on implementing Realtime.

7. Test your service end to end

It’s advisable that you create recipes using each trigger and action from your service on IFTTT to ensure that things work as expected. Your user will have special preview access to use the service on IFTTT.

8. Add service administrators

If we need to contact you about the service, we’ll use the information you provide us under the Service Administrators section.

9. Submit your service for review

Once you’re confident your service is going to delight users, submit it! You can find the submit link underneath the “Publish” tab on your service’s dashboard.


Ready to start?

Create your "Hello World" service