Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
OurBuilding Ambient Agents with LangGraph course is now available on LangChain Academy!
Open In ColabOpen on GitHub

IFTTT WebHooks

This notebook shows how to use IFTTT Webhooks.

Fromhttps://github.com/SidU/teams-langchain-js/wiki/Connecting-IFTTT-Services.

Creating a webhook

Configuring the "If This"

  • Click on the "If This" button in the IFTTT interface.
  • Search for "Webhooks" in the search bar.
  • Choose the first option for "Receive a web request with a JSON payload."
  • Choose an Event Name that is specific to the service you plan to connect to.This will make it easier for you to manage the webhook URL.For example, if you're connecting to Spotify, you could use "Spotify" as yourEvent Name.
  • Click the "Create Trigger" button to save your settings and create your webhook.

Configuring the "Then That"

  • Tap on the "Then That" button in the IFTTT interface.
  • Search for the service you want to connect, such as Spotify.
  • Choose an action from the service, such as "Add track to a playlist".
  • Configure the action by specifying the necessary details, such as the playlist name,e.g., "Songs from AI".
  • Reference the JSON Payload received by the Webhook in your action. For the Spotifyscenario, choose{{JsonPayload}} as your search query.
  • Tap the "Create Action" button to save your action settings.
  • Once you have finished configuring your action, click the "Finish" button tocomplete the setup.
  • Congratulations! You have successfully connected the Webhook to the desiredservice, and you're ready to start receiving data and triggering actions 🎉

Finishing up

%pip install--upgrade--quiet  langchain-community
from langchain_community.tools.iftttimport IFTTTWebhook
API Reference:IFTTTWebhook
import os

key= os.environ["IFTTTKey"]
url=f"https://maker.ifttt.com/trigger/spotify/json/with/key/{key}"
tool= IFTTTWebhook(
name="Spotify", description="Add a song to spotify playlist", url=url
)
tool.run("taylor swift")
"Congratulations! You've fired the spotify JSON event"

Related


[8]ページ先頭

©2009-2025 Movatter.jp