javascript - 如何指定从应用程序脚本到 IFTTT Maker channel 的可选 JSON 正文?

标签 javascript google-apps-script ifttt

我正在尝试通过 Maker channel 发送 IFTTT 请求并想发送一些额外的数据(状态)。这是我正在使用的代码(在 Google App 脚本中):

function postToMaker(url, status) {
  var payload = {
    "status": status
  };

  var payloadJson = JSON.stringify(payload);

  var options = {
    'method': 'post',
    'contentType': 'json',
    'payload': payloadJson
  };

  UrlFetchApp.fetch(url, options);
}

代码触发 IFTTT,但变量“status”未作为额外数据发送。我确定我缺少一些小东西。感谢您的所有建议。

最佳答案

您的负载仅限于“value1”、“value2”和“value3”键。

To trigger an Event Make a POST or GET web request to:

https://maker.ifttt.com/trigger/{event}/with/key/f_lWZAtMef6szM4PCoHSpSndFhd95dmQ3WkhX_qheOW.

With an optional JSON body of:

{ "value1" : "", "value2" : "", "value3" : "" }

The data is completely optional, and you can also pass value1, value2, and value3 as query parameters or form variables. This content will be passed on to the Action in your Recipe.

关于javascript - 如何指定从应用程序脚本到 IFTTT Maker channel 的可选 JSON 正文?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35243941/

相关文章:

google-apps-script - 强制重新发布谷歌电子表格的脚本

google-apps-script - Google Apps 脚本 : `Those rows are out of bounds.` error

amazon-web-services - 如何获取 AWS IoT Button 的 IFTTT Maker Applet API key

javascript - React 电子邮件验证中的正则表达式

javascript - 初学者 - Javascript 中的深度比较

google-apps-script - IFFT 填充的 Google 电子表格日志不会触发 onEdit 脚本

linux - 通过 IFTTT 在树莓派中运行 bash 脚本

javascript - 我如何在单个选择上存储两个信息并在单独的文本框 HTML/JS 中调用它们

javascript - ASP.Net 不编译 AngularJS

IFTTT + Maker URL 触发器未触发