IFTTT integration
IFTTT (If This Then That) integrations enable you to trigger conditional chains, and help to combine various services together when an event occurs in Ably.
Create a IFTTT integration
To create an IFTTT integration in your dashboard:
- Login and select the application you wish to integrate with IFTTT.
- Click the Integrations tab.
- Click the New Integration Rule button.
- Choose Webhook.
- Choose IFTTT.
- Configure the IFTTT settings.
- Click Create.
You can also create an IFTTT integration using the Control API.
Settings
The following settings are available when creating an IFTTT integration:
Setting | Description |
---|---|
IFTTT Webhook key | The webhook key for your IFTTT account. |
Event name | The name used to identify the IFTTT applet. |
Source | Specifies the event types being sent to IFTTT. |
Channel filter | Filters the source channels based on a regular expression. |
Encoding | Specifies the encoding format of messages. Either JSON or MsgPack. |
Restrictions
IFTTT has limitations on the data it can process. All payloads must be JSON
and use only the keys value1
, value2
, or value3
. Any other format or additional keys will not be processed.
As a result, enveloping, “batching”:/docs/integrations/webhooks#batching are not supported. Additionally, protocols that require decoding such as MQTT, are not supported with IFTTT.
To ensure data is processed by IFTTT, it must match the required IFTTT structure. The following example shows the headers and payload sent to IFTTT when a message is sent to a channel:
{
"value1" :"data I want to send 1",
"value2" :"data I want to send 2",
"value3" :"data I want to send 3"
}
CopyCopied!
For a message data or presence message data of { "value1": "My first message", "value2": "My second message" }
, the following would be sent to your IFTTT endpoint:
Headers:
host: https://maker.ifttt.com/trigger/{YOUR_EVENT}/with/key/{YOUR_IFTTT_KEY}
content-type: application/json
x-ably-envelope-appid: {YOUR_APP_ID}
x-ably-envelope-channel: {YOUR_CHANNEL}
x-ably-envelope-rule-id: {YOUR_RULE_ID}
x-ably-envelope-site: {ably-server-location}
x-ably-envelope-source: channel.message
x-ably-message-encoding: json
x-ably-message-id: {UNIQUE_ABLY_MESSAGE_ID}
x-ably-message-timestamp: {TIMESTAMP_ORIGINAL_MESSAGE_WAS_SENT}
x-ably-version: 1.2
content-length: 18
connection: keep-alive
CopyCopied!
Payload:
{
"value1": "My first message",
"value2": "My second message"
}
CopyCopied!