Documentation

Embedding Applets

Once your service is set up on the platform, you can use the tools on this page to make Applets available to anyone who uses your app, website, chatbot, or other client experience.

Listing your Applets in a web view

The simplest way to embed Applets into your product is to open a web view that lists your service’s Applets and lets the user configure, enable, or disable them. This is an easy way to get started, but it’s less flexible than using our SDKs or API. See the Embedding a web view section for more details.

iOS and Android SDKs

The iOS SDK and Android SDK, which are powered by the IFTTT API, make it easy to integrate Applets directly into your apps. We provide wrappers and data models for the various endpoints of the REST API. You can use the data returned to display your Applets within your app however you’d like. We’ll also provide web URLs that allow your users to activate Applets.

View the Android SDK on GitHub

View the iOS SDK on GitHub

IFTTT API

The most powerful way to integrate IFTTT with your product is the IFTTT API, which can be used on its own or in conjunction with our mobile SDKs. We’d recommend reading the IFTTT API’s documentation even if you intend to use the mobile SDKs, since it thoroughly explains the structure and capabilities of the API that the SDKs are built on top of.

Example integration

We’ve created an example integration that uses the IFTTT API to display a list of Applets and let the user configure, enable, and disable them. You can review its documentation and source code to see a working example of a full integration with the API.

View the IFTTT API Example on GitHub

Embedding a web view

Regardless of how you integrate IFTTT into your product, the initial setup for each Applet has to happen on an IFTTT-hosted webpage. IFTTT provides two entry points for embedded web views, one that lists all of the Applets belonging to a service and one that displays a single Applet.

Note that you must not use a browser popup window, <iframe>, UIWebView or WKWebView on iOS, or WebView UI element on Android to embed these pages. All of these methods of embedding are prohibited from using OAuth flows hosted by some services, including Google, and enabling an Applet requires granting access to services via OAuth. Instead, open these pages in a new browser tab, an SFSafariViewController on iOS, or a Chrome Custom Tab on Android.

Making sure the user is logged in

Before the user can enable any Applet belonging to your service, they’ll need to connect your service to their IFTTT account using OAuth. To ensure a smooth activation process, you have to make sure the user is logged in on your website before sending them to IFTTT. This ensures that the user won’t be prompted to log in to your site again when enabling the Applet, which would add another unnecessary step to the flow and could create confusion.

The method you use to log the user in will depend on how your product works, but we’d suggest something like this (assuming the user is already logged into your app and your app has some way to authenticate calls to your backend):

  1. Your app asks your backend to generate a token that can log in the currently-authenticated user. This token should have a very short expire time to reduce the risk of abuse.

  2. Your app opens a web view that loads a page on your server, passing in two parameters as part of the URL: the token generated in the previous step and the URL on IFTTT that you want to send the user to.

  3. Your server logs the user in based on the token you passed in, then redirects them to the specified URL on IFTTT.

  4. Now, when the user needs to connect their IFTTT account to your service, they’ll already be logged into your service in the web view.

The example integration includes a demonstration of this flow, implemented using JWT.

Showing your service

If you’re looking for a lightweight way to embed your Applets, you can open a web view that shows an embedded version of your entire service page, listing all of your Applets and letting the user configure, enable, or disable them. If you want more control over how the Applets are displayed, be sure to check out the iOS and Android SDKs and the IFTTT API.

Building a service URL

The URL for embedding your service is just https://ifttt.com/embed/{{service_id}}. For example, the embed URL for the Email service is https://ifttt.com/embed/email. However, there are a couple of optional query parameters you may want to include in the URL:

Parameter Description
email If you include the user’s email address as a parameter, we’ll try to streamline the process of logging into or signing up for IFTTT by looking for a matching account or prefilling the signup form. Make sure any special characters in the email are percent-encoded; for example, @ should be encoded as %40 and + should be encoded as %2B.
invite_code If your service isn’t published yet, you should include the service’s invite code (see Unpublished services in the IFTTT API documentation) as a parameter. This will allow you to test the flow as a logged-out user or a user who doesn’t have preview access to your service.
iOS: Swift
import UIKit
import SafariServices

let serviceId = "YOUR_SERVICE_ID"

// Construct URL
let appletIndexURL: NSURL = {
    let components = NSURLComponents(string: "https://ifttt.com/embed/\(serviceId)")
    return components!.URL!
}()

// Open URL with SFSafariViewController or in Safari app
if #available(iOS 9.0, *) {
    let controller = SFSafariViewController(URL: appletIndexURL)
    presentViewController(controller, animated: true, completion: nil)
} else {
    UIApplication.sharedApplication().openURL(appletIndexURL)
}
iOS: Objective-C
@import Foundation;
@import SafariServices;

NSString *serviceId = @"YOUR_SERVICE_ID";

// Construct URL
NSURLComponents *appletIndexComponents = [[NSURLComponents alloc] initWithString:[NSString stringWithFormat:@"https://ifttt.com/embed/%@", serviceId]];
NSURL *appletIndexURL = appletIndexComponents.URL;

// Open URL with SFSafariViewController or in Safari app
if ([SFSafariViewController class]) {
    SFSafariViewController *sfViewController = [[SFSafariViewController alloc] initWithURL:appletIndexURL];
    [self presentViewController:sfViewController animated:YES completion:nil];
} else {
    [[UIApplication sharedApplication] openURL:appletIndexURL];
}
Android
Uri uri = new Uri.Builder()
    .scheme("https")
    .authority("ifttt.com")
    .appendPath("embed")
    .appendPath("YOUR_SERVICE_ID")
    .build();

// Open the embedded web view on a browser
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
activity.startActivity(intent);

// Open the embedded web view on Chrome Custom tabs
CustomTabsIntent intent = new CustomTabsIntent.Builder().build();
intent.launchUrl(context, uri);

Showing an Applet

You can also send the user directly to an embedded page representing a single Applet. This is a necessary part of any integration that uses the iOS and Android SDKs or the IFTTT API, since the initial configuration of any Applet has to happen through IFTTT’s web UI.

Building an Applet URL

The base URL for embedding an Applet is https://ifttt.com/embed/{{service_id}}/applets/{{applet_id}}. However, in order to fully integrate this flow into your app, there are some query parameters you should add:

Parameter Description
redirect_uri The URI that IFTTT should redirect the user to when they’re done enabling or configuring the Applet. This has to be on the list of allowed URIs located on the Redirects page in your service’s settings. If you don’t send this parameter, or if you send a URI that isn’t on the list, the user will be redirected to your service page instead.
email If you include the user’s email address as a parameter, we’ll try to streamline the process of logging into or signing up for IFTTT by looking for a matching account or prefilling the signup form. Make sure any special characters in the email are percent-encoded; for example, @ should be encoded as %40 and + should be encoded as %2B.
user_id If you include your service’s id for the user as a parameter, we’ll make sure that they log into the correct IFTTT account. it will also be used to streamline the process of logging into or signing up for IFTTT. See the Authentication section of the IFTTT API docs for more information about user_id.
invite_code If your service isn’t published yet, you should include the service’s invite code (see Unpublished services in the IFTTT API docs) as a parameter. This will allow you to test the flow as a logged-out user or a user who doesn’t have preview access to your service.

IFTTT API

The IFTTT API is the most flexible way to embed Applets into your product. You can use it to list your service’s Applets, prompt a user to sign up for IFTTT and configure an Applet, or let a user enable or disable Applets that they’ve previously configured.

If your goal is to embed Applets into an iOS or Android app, you might want to start by looking at IFTTT’s iOS and Android SDKs, which wrap this API and make it easy to use in your app.

The basics

This is a REST API that’s located at https://api.ifttt.com. All API responses are formatted as JSON objects, and any requests that include a body should also be formatted as JSON and include a Content-Type: application/json header.

Throughout these docs, we’ll use {{service_id}} as a placeholder for your service’s unique identifier, which can be found in the Service tab of the Partner Platform under the IFTTT service ID heading.

HTTP status codes

The following set of HTTP response status codes may be returned when you send requests to the API. The 200 status code will be returned for successful requests, while any other status code indicates an error.

Status Description
200 The request succeeded.
400 The request was invalid.
401 The request was missing needed credentials or had badly-formed headers or an invalid token.
403 The request was authenticated correctly, but the current service or user doesn’t have permission to make the requested call.
404 The requested resource couldn’t be found, either because of an invalid ID or because you aren’t allowed to see it.
422 The request failed because of invalid parameters.
500 There was an internal error. If this persists, please contact us.
Error responses

Like success responses, error responses will be JSON objects. All error responses have the following structure:

  • type: The string "error", to distinguish errors from other objects in the API.
  • code: A machine-readable string categorizing the failure.
  • message: A human-readable error message describing the failure.
Example: Requesting a non-existent service
  • Request
    GET /v1/services/not_a_real_service/applets
    Host: api.ifttt.com
    
  • Response
    HTTP/1.1 404 Not Found
    Content-Type: application/json; charset=utf-8
    
    {
      "type": "error",
      "code": "not_found",
      "message": "Unknown service name"
    }
    
Authentication

Every request is authenticated in one of three ways:

  1. Unauthenticated: A request made with no credentials. Requests at this level can only read publicly-visible information.

  2. Service-authenticated: A request that includes an IFTTT-Service-Key header containing your service key, found in the API tab of the Partner Platform under the Service Key heading. You can use this approach when you’re making calls from your backend servers to the API.

    Requests at this level may also include a user_id parameter specifying a user of your service on whose behalf you’re making the request. This user_id has to match the id that your service returns to IFTTT from its User information endpoint for a given user. Some endpoints can return extra user-specific information if you send a valid user_id, while other endpoints require you to send a user_id when you call them with a service key.

  3. User-authenticated: A request that includes an Authorization header containing a user-specific token that IFTTT has issued to your service. This approach lets you make calls to the API from places like mobile apps or browsers where it would be inappropriate to expose your service key. See the documentation for the Get a user token endpoint for more information.

Regardless of how your request is authenticated, you can use the Show the current service and user endpoint to get information about the currently-authenticated service and/or user.

Example: Unauthenticated
  • Request
    GET /v1/me
    Host: api.ifttt.com
    
Example: Service-authenticated
  • Request
    GET /v1/me
    Host: api.ifttt.com
    IFTTT-Service-Key: 6e7c8978c07a3b5918a237b9b5b1bb70
    
Example: User-authenticated
  • Request
    GET /v1/me
    Host: api.ifttt.com
    Authorization: Bearer ae11b3e7fcdcc337e34faa9dcf4f0df5
    
Unpublished services

If your service hasn’t been published on IFTTT yet, it won’t always be visible through the API. For example, an unauthenticated call to the List Applets endpoint will return a 404 response if the given service is unpublished.

In order to let developers build and test integrations with unpublished services, the API supports an IFTTT-Invite-Code header that can be sent with any API call. This header should contain the code found in the Service tab of the Partner Platform under the Invite URL heading. Any request that includes this header will be able to see the relevant service as if it had already been published.

Example: Sending the IFTTT-Invite-Code header
  • Request
    GET /v1/services/{{service_id}}/applets
    Host: api.ifttt.com
    IFTTT-Invite-Code: 21790-7d53f29b1eaca0bdc5bd6ad24b8f4e1c
    

Endpoints

Show the current service and user

Authentication: Unauthenticated, service-authenticated, or user-authenticated

URL: GET https://api.ifttt.com/v1/me

This endpoint returns information about the authentication of the current request. You can use this to verify that you’re using a valid service key or user token; you can also use it to determine whether the user_id you sent is currently connected to an IFTTT account and, if so, what that IFTTT account’s login is.

Example: Unauthenticated
  • Request
    GET /v1/me
    Host: api.ifttt.com
    
  • Response
    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
      "type": "me",
      "authentication_level": "none",
      "service_id": null,
      "user_login": null
    }
    
Example: Service-authenticated
  • Request
    GET /v1/me
    Host: api.ifttt.com
    IFTTT-Service-Key: 6e7c8978c07a3b5918a237b9b5b1bb70
    
  • Response
    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
      "type": "me",
      "authentication_level": "channel",
      "service_id": "acme_social_network",
      "user_login": null
    }
    
Example: Service-authenticated with user ID
  • Request
    GET /v1/me?user_id={{user_id}}
    Host: api.ifttt.com
    IFTTT-Service-Key: 6e7c8978c07a3b5918a237b9b5b1bb70
    
  • Response
    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
      "type": "me",
      "authentication_level": "channel",
      "service_id": "acme_social_network",
      "user_login": "example_user"
    }
    
Example: User-authenticated
  • Request
    GET /v1/me
    Host: api.ifttt.com
    Authorization: Bearer ae11b3e7fcdcc337e34faa9dcf4f0df5
    
  • Response
    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
      "type": "me",
      "authentication_level": "user",
      "service_id": "acme_social_network",
      "user_login": "example_user"
    }
    
List Applets

Authentication: Unauthenticated, service-authenticated, or user-authenticated

URL: GET https://api.ifttt.com/v1/services/{{service_id}}/applets

Parameter Description
order The order that you want the Applets returned in. The choices are published_at_desc, published_at_asc, enabled_count_desc, and enabled_count_asc. The default order is based on a combination of popularity and how recently each of the Applets was published.
platform If you’re displaying Applets in a mobile app, you can send this parameter with a value of either ios or android to exclude Applets that rely on services that are specific to the other platform. For example, if you send platform=ios, Applets that use the Android Photos service won’t be listed.

This endpoint lists all of the published Applets belonging to the given service. If the request is authenticated as a specific user, either by passing a user_id parameter or by sending an Authorization header containing a user token, the response will include information about each Applet’s status in relation to that user.

The possible values for the user_status field on an applet object are:

Status Description
null No user specified or user not found.
"enabled" Currently turned on.
"disabled" Turned off after being turned on.
"never_enabled" Deleted by user or never turned on.
Example: List Applets, unauthenticated
  • Request
    GET /v1/services/{{service_id}}/applets
    Host: api.ifttt.com
    
  • Response
    {
      "type": "list",
      "data": [
        {
          "type": "applet",
          "id": "C8p3q9T6",
          "name": "Archive your posts",
          "description": "Archive all of your ACME Social Network posts to your ACME Cloud Storage account.",
          "published_at": "2017-08-27T12:52:59-07:00",
          "enabled_count": 772,
          "user_status": null,
          "last_run_at": null,
          "services": [
            {
              "service_id": "acme_social_network",
              "service_name": "ACME Social Network",
              "is_primary": true,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#c783ea",
              "url": "https://ifttt.com/acme_social_network"
            },
            {
              "service_id": "acme_cloud_storage",
              "service_name": "ACME Cloud Storage",
              "is_primary": false,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#3cc292",
              "url": "https://ifttt.com/acme_cloud_storage"
            }
          ],
          "url": "https://ifttt.com/applets/C8p3q9T6",
          "embedded_url": "https://ifttt.com/embed/acme_cloud_storage/applets/C8p3q9T6"
        },
        {
          "type": "applet",
          "id": "C2aDx8wh",
          "name": "Post new photos",
          "description": "When you store a new photo in ACME Cloud Storage, automatically post it to ACME Social Network.",
          "published_at": "2017-09-07T18:47:05-07:00",
          "enabled_count": 208,
          "user_status": null,
          "last_run_at": null,
          "services": [
            {
              "service_id": "acme_cloud_storage",
              "service_name": "ACME Cloud Storage",
              "is_primary": false,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#3cc292",
              "url": "https://ifttt.com/acme_cloud_storage"
            },
            {
              "service_id": "acme_social_network",
              "service_name": "ACME Social Network",
              "is_primary": true,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#c783ea",
              "url": "https://ifttt.com/acme_social_network"
            }
          ],
          "url": "https://ifttt.com/applets/C2aDx8wh",
          "embedded_url": "https://ifttt.com/embed/acme_cloud_storage/applets/C2aDx8wh"
        }
      ]
    }
    
Example: List Applets, service-authenticated with user ID
  • Request
    GET /v1/services/{{service_id}}/applets?user_id={{user_id}}
    Host: api.ifttt.com
    IFTTT-Service-Key: {{service_key}}
    
  • Response
    {
      "type": "list",
      "data": [
        {
          "type": "applet",
          "id": "C8p3q9T6",
          "name": "Archive your posts",
          "description": "Archive all of your ACME Social Network posts to your ACME Cloud Storage account.",
          "published_at": "2017-08-27T12:52:59-07:00",
          "enabled_count": 772,
          "user_status": "enabled",
          "last_run_at": "2017-09-08T01:46:42+00:00",
          "services": [
            {
              "service_id": "acme_social_network",
              "service_name": "ACME Social Network",
              "is_primary": true,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#c783ea",
              "url": "https://ifttt.com/acme_social_network"
            },
            {
              "service_id": "acme_cloud_storage",
              "service_name": "ACME Cloud Storage",
              "is_primary": false,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#3cc292",
              "url": "https://ifttt.com/acme_cloud_storage"
            }
          ],
          "url": "https://ifttt.com/applets/C8p3q9T6",
          "embedded_url": "https://ifttt.com/embed/acme_cloud_storage/applets/C8p3q9T6"
        },
        {
          "type": "applet",
          "id": "C2aDx8wh",
          "name": "Post new photos",
          "description": "When you store a new photo in ACME Cloud Storage, automatically post it to ACME Social Network.",
          "published_at": "2017-09-07T18:47:05-07:00",
          "enabled_count": 208,
          "user_status": "never_enabled",
          "last_run_at": null,
          "services": [
            {
              "service_id": "acme_cloud_storage",
              "service_name": "ACME Cloud Storage",
              "is_primary": false,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#3cc292",
              "url": "https://ifttt.com/acme_cloud_storage"
            },
            {
              "service_id": "acme_social_network",
              "service_name": "ACME Social Network",
              "is_primary": true,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#c783ea",
              "url": "https://ifttt.com/acme_social_network"
            }
          ],
          "url": "https://ifttt.com/applets/C2aDx8wh",
          "embedded_url": "https://ifttt.com/embed/acme_cloud_storage/applets/C2aDx8wh"
        }
      ]
    }
    
Example: List Applets, service-authenticated with user ID, most-popular first
  • Request
    GET /v1/services/{{service_id}}/applets?user_id={{user_id}}&order=enabled_count_desc
    Host: api.ifttt.com
    IFTTT-Service-Key: {{service_key}}
    
  • Response
    {
      "type": "list",
      "data": [
        {
          "type": "applet",
          "id": "C8p3q9T6",
          "name": "Archive your posts",
          "description": "Archive all of your ACME Social Network posts to your ACME Cloud Storage account.",
          "published_at": "2017-08-27T12:52:59-07:00",
          "enabled_count": 772,
          "user_status": "enabled",
          "last_run_at": "2017-09-08T01:46:42+00:00",
          "services": [
            {
              "service_id": "acme_social_network",
              "service_name": "ACME Social Network",
              "is_primary": true,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#c783ea",
              "url": "https://ifttt.com/acme_social_network"
            },
            {
              "service_id": "acme_cloud_storage",
              "service_name": "ACME Cloud Storage",
              "is_primary": false,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#3cc292",
              "url": "https://ifttt.com/acme_cloud_storage"
            }
          ],
          "url": "https://ifttt.com/applets/C8p3q9T6",
          "embedded_url": "https://ifttt.com/embed/acme_cloud_storage/applets/C8p3q9T6"
        },
        {
          "type": "applet",
          "id": "C2aDx8wh",
          "name": "Post new photos",
          "description": "When you store a new photo in ACME Cloud Storage, automatically post it to ACME Social Network.",
          "published_at": "2017-09-07T18:47:05-07:00",
          "enabled_count": 208,
          "user_status": "never_enabled",
          "last_run_at": null,
          "services": [
            {
              "service_id": "acme_cloud_storage",
              "service_name": "ACME Cloud Storage",
              "is_primary": false,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#3cc292",
              "url": "https://ifttt.com/acme_cloud_storage"
            },
            {
              "service_id": "acme_social_network",
              "service_name": "ACME Social Network",
              "is_primary": true,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#c783ea",
              "url": "https://ifttt.com/acme_social_network"
            }
          ],
          "url": "https://ifttt.com/applets/C2aDx8wh",
          "embedded_url": "https://ifttt.com/embed/acme_cloud_storage/applets/C2aDx8wh"
        }
      ]
    }
    
Example: List Applets, specifying the iOS platform
  • Request
    GET /v1/services/{{service_id}}/applets?platform=ios
    Host: api.ifttt.com
    
  • Response
    {
      "type": "list",
      "data": [
        {
          "type": "applet",
          "id": "CCn2aELq",
          "name": "Send a message when you add a photo to an iOS Photos album",
          "description": "Send a message on ACME Cloud Storage when you add a photo to a specific album on your iOS device.",
          "published_at": "2017-09-07T19:07:04-07:00",
          "enabled_count": 0,
          "user_status": null,
          "last_run_at": null,
          "services": [
            {
              "service_id": "ios_photos",
              "service_name": "iOS Photos",
              "is_primary": false,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#e8655c",
              "url": "https://ifttt.com/ios_photos"
            },
            {
              "service_id": "acme_cloud_storage",
              "service_name": "ACME Cloud Storage",
              "is_primary": true,
              "monochrome_icon_url": "...",
              "color_icon_url": "...",
              "brand_color": "#3cc292",
              "url": "https://ifttt.com/acme_cloud_storage"
            }
          ],
          "url": "https://ifttt.com/applets/CCn2aELq",
          "embedded_url": "https://ifttt.com/embed/acme_cloud_storage/applets/CCn2aELq"
        }
      ]
    }
    
Show an Applet

Authentication: Unauthenticated, service-authenticated, or user-authenticated

URL: GET https://api.ifttt.com/v1/services/{{service_id}}/applets/{{applet_id}}

This endpoint is similar to the List Applets endpoint but returns a specific Applet instead of a list.

Example: Show an Applet, service-authenticated with user ID
  • Request
    GET /v1/services/{{service_id}}/applets/{{applet_id}}?user_id={{user_id}}
    Host: api.ifttt.com
    IFTTT-Service-Key: {{service_key}}
    
  • Response
    {
      "type": "applet",
      "id": "C8p3q9T6",
      "name": "Archive your posts",
      "description": "Archive all of your ACME Social Network posts to your ACME Cloud Storage account.",
      "published_at": "2017-08-27T12:52:59-07:00",
      "enabled_count": 772,
      "user_status": "enabled",
      "last_run_at": "2017-09-08T01:46:42+00:00",
      "services": [
        {
          "service_id": "acme_social_network",
          "service_name": "ACME Social Network",
          "is_primary": true,
          "monochrome_icon_url": "...",
          "color_icon_url": "...",
          "brand_color": "#c783ea",
          "url": "https://ifttt.com/acme_social_network"
        },
        {
          "service_id": "acme_cloud_storage",
          "service_name": "ACME Cloud Storage",
          "is_primary": false,
          "monochrome_icon_url": "...",
          "color_icon_url": "...",
          "brand_color": "#3cc292",
          "url": "https://ifttt.com/acme_cloud_storage"
        }
      ],
      "url": "https://ifttt.com/applets/C8p3q9T6",
      "embedded_url": "https://ifttt.com/embed/acme_cloud_storage/applets/C8p3q9T6"
    }
    
Enable an Applet

Authentication: Service-authenticated or user-authenticated

URL: POST https://api.ifttt.com/v1/services/{{service_id}}/applets/{{applet_id}}/enable

This endpoint, along with its partner Disable an Applet, requires the request to be authenticated as a specific user, either by passing a user_id parameter or by sending an Authorization header containing a user token. It also requires the relevant Applet to have already been configured by the user; in practice, this means that the Applet has to have the "disabled" status in order to re-enable it with this endpoint. If the request succeeds, the status will become "enabled".

Enabling an Applet through this endpoint will add an event to the user’s Activity page.

Example: Enable an Applet, service-authenticated with user ID
  • Request
    POST /v1/services/{{service_id}}/applets/{{applet_id}}/enable?user_id={{user_id}}
    Host: api.ifttt.com
    IFTTT-Service-Key: {{service_key}}
    
  • Response
    {
      "type": "applet",
      "id": "C8p3q9T6",
      "name": "Archive your posts",
      "description": "Archive all of your ACME Social Network posts to your ACME Cloud Storage account.",
      "published_at": "2017-08-27T12:52:59-07:00",
      "enabled_count": 772,
      "user_status": "enabled",
      "last_run_at": "2017-09-08T01:46:42+00:00",
      "services": [
        {
          "service_id": "acme_social_network",
          "service_name": "ACME Social Network",
          "is_primary": true,
          "monochrome_icon_url": "...",
          "color_icon_url": "...",
          "brand_color": "#c783ea",
          "url": "https://ifttt.com/acme_social_network"
        },
        {
          "service_id": "acme_cloud_storage",
          "service_name": "ACME Cloud Storage",
          "is_primary": false,
          "monochrome_icon_url": "...",
          "color_icon_url": "...",
          "brand_color": "#3cc292",
          "url": "https://ifttt.com/acme_cloud_storage"
        }
      ],
      "url": "https://ifttt.com/applets/C8p3q9T6",
      "embedded_url": "https://ifttt.com/embed/acme_cloud_storage/applets/C8p3q9T6"
    }
    
Disable an Applet

Authentication: Service-authenticated or user-authenticated

URL: POST https://api.ifttt.com/v1/services/{{service_id}}/applets/{{applet_id}}/disable

This endpoint, along with its partner Enable an Applet, requires the request to be authenticated as a specific user, either by passing a user_id parameter or by sending an Authorization header containing a user token. The relevant Applet has to have the "enabled" status for that user in order for this request to be valid; if the request succeeds, the Applet’s status will become "disabled".

Disabling an Applet through this endpoint will add an event to the user’s Activity page.

Example: Disable an Applet, service-authenticated with user ID
  • Request
    POST /v1/services/{{service_id}}/applets/{{applet_id}}/disable?user_id={{user_id}}
    Host: api.ifttt.com
    IFTTT-Service-Key: {{service_key}}
    
  • Response
    {
      "type": "applet",
      "id": "C8p3q9T6",
      "name": "Archive your posts",
      "description": "Archive all of your ACME Social Network posts to your ACME Cloud Storage account.",
      "published_at": "2017-08-27T12:52:59-07:00",
      "enabled_count": 771,
      "user_status": "disabled",
      "last_run_at": "2017-09-08T01:46:42+00:00",
      "services": [
        {
          "service_id": "acme_social_network",
          "service_name": "ACME Social Network",
          "is_primary": true,
          "monochrome_icon_url": "...",
          "color_icon_url": "...",
          "brand_color": "#c783ea",
          "url": "https://ifttt.com/acme_social_network"
        },
        {
          "service_id": "acme_cloud_storage",
          "service_name": "ACME Cloud Storage",
          "is_primary": false,
          "monochrome_icon_url": "...",
          "color_icon_url": "...",
          "brand_color": "#3cc292",
          "url": "https://ifttt.com/acme_cloud_storage"
        }
      ],
      "url": "https://ifttt.com/applets/C8p3q9T6",
      "embedded_url": "https://ifttt.com/embed/acme_cloud_storage/applets/C8p3q9T6"
    }
    
Get a user token

Authentication: Service-authenticated

URL: POST https://api.ifttt.com/v1/services/{{service_id}}/user_token

This endpoint can be used to obtain a token for a specific user, allowing you to make user-authenticated requests. There are a couple of reasons you might want to do this:

  1. Your service key can be used to make calls on behalf of any user, but a user token is limited to a single user. This makes user tokens much less sensitive; if you want, you could use a user token to make calls from a mobile app to IFTTT, whereas you’d never want to embed your service key into a mobile app because it could be read by end users.

  2. In the future, we’re likely to add API endpoints that require a user token, since user tokens provide stronger authentication.

In addition to the IFTTT-Service-Key header and the user_id parameter (see the Authentication section for more information about these), you need to also provide a token parameter containing the OAuth access token or refresh token that you issued to IFTTT on behalf of this user when they connected their IFTTT account to your service. This lets us verify the request more stringently than if you just provided your service key, without making the user go through a redundant OAuth flow.

Once you receive the user token, you should store it securely for use in subsequent requests to our API.

Example: Get a user token, Service-authenticated with user ID and OAuth token
  • Request
    POST /v1/services/{{service_id}}/user_token?user_id={{user_id}}
    Host: api.ifttt.com
    IFTTT-Service-Key: {{service_key}}
    Content-Type: application/json
    
    {
      "token": "{{token}}"
    }
    
  • Response
    {
      "type": "user_token",
      "user_token": "e1hMBWw44mJM902c6ye9mmuS3nd4A_8eTCU99D4a5KQW7cT1"
    }
    

Activating an Applet

Before you can use the API to disable or re-enable an Applet, the user needs to configure it through IFTTT’s web UI. You can send the user to a page that will take them through the process of enabling the Applet and then redirect them back to your app. The user also needs to go through this flow to edit the configuration of an Applet that they’ve already enabled.

You can discover the URL that the user needs to visit to configure a given Applet by calling the List Applets or Show an Applet endpoint and looking for the embedded_url field on each applet object. However, in order to fully integrate this flow into your app, you need to add some query parameters to the URL.

For example, given this Applet:

{
  "type": "applet",
  "id": "C8p3q9T6",
  "name": "Archive your posts",
  "description": "Archive all of your ACME Social Network posts to your ACME Cloud Storage account.",
  // ... more fields ...
  "embedded_url": "https://ifttt.com/embed/acme_cloud_storage/applets/C8p3q9T6"
}

Assuming you have myapp://ifttt_callback configured as a permitted redirect URI on the Redirects page of your service’s settings, you might direct the user to the following URL:

https://ifttt.com/embed/acme_cloud_storage/applets/C8p3q9T6?redirect_uri=myapp://ifttt_callback%3Fapplet_id%3DC8p3q9T6&email=my_email@example.com

We’ll then redirect the user back to your app once they’ve either enabled the Applet or canceled the flow.

Check out the Showing an applet section for more details.