Instructions for transferring data to the Maker Channel on IFTTT using google scripts

I'm currently experimenting with using the IFTTT Maker Channel to generate a new text file in my Dropbox through Google Apps script. By connecting "value1" and "value2" to the content of the file, I attempted to implement the following code snippet (with the api key omitted).

function sendFileToMaker(){
  var makerKey = 'app_key';
  var eventName = 'Test_Event';
  var url = 'https://maker.ifttt.com/trigger/' + eventName + '/with/key/' + makerKey;
  var payload = {
    "value1" : "test",
    "value2" : "testFile"
  };
  
  var options = {
    "method" : "POST",
    "contentType": "json",
    "payload":payload,
  };
  Logger.log(UrlFetchApp.fetch(url,options));
  
};

The trigger seems to be activated, but the values are not being recognized correctly. Although the message "Congratulations! You've fired the Test_Event event" is displayed without any apparent errors, the resulting file is empty.

What am I missing here? How can I resolve this issue?

Answer №1

After some troubleshooting, I pinpointed the mistake in my code. It turns out that removing the content type made the call work perfectly. I made some adjustments to the function to streamline its usage.

function sendToMaker(makerKey,eventName,value1,value2,value3){
  var url = 'https://maker.ifttt.com/trigger/' + eventName + '/with/key/' + makerKey;
  var payload = {
    'value1' : value1,
    'value2' : value2,
    'value3' : value3
  };

  var options = {
    'method' : 'POST',
    'payload':payload,
  };
  return UrlFetchApp.fetch(url,options)
};

You have the option to send text through to the Maker Channel or download URLs for adding files from Google Drive to Dropbox.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Timing of React setState updates

Currently, I am working on developing a memory game using React. The main objective of the game is to click on cards without repeating any selections in order to earn points. If the same card is clicked twice, it results in losing the game. This project se ...

Issue with Braintree drop-in form: Nonce string generation problem

I've encountered a peculiar issue while trying to utilize the dropin form from Braintree. Successfully integrating the form into a view, here's how it looks: <form id="createTransactionForm" method="post" action="#&qu ...

Automate page refresh using Selenium in Java until target element becomes visible

Is there a way to have selenium wait for 3 minutes before refreshing the page until a specific element (in this case, the Download button) is found? I've attempted the code below, but it doesn't seem to be effective. Note: I am trying to upload ...

Deleting a JSON element with NODEJS

I am working with a json file and attempting to delete an element using the code below. exports.delete = function(req, res) { var deletearticle = articles[req.params.id]; delete articles[req.params.id]; fs.writeFile('server/article ...

Is it acceptable to generate a React Element from another Element in ReactJs?

One time, I came across a code that looked like this: var App = <div> Hello World </div>; ReactDOM.render(<App />, <selector>) Surprisingly, it was working perfectly fine. However, I couldn't grasp what was actually happening ...

The Power of AngularJS - Unlocking the Potential of Module Configuration

Exploring the concepts in this AngularJS example: angular.module('myModule', [], function($provide) { $provide.factory('serviceId', function() { var shinyNewServiceInstance; //the factory function creates shinyNewServiceInsta ...

Having trouble rendering JSON encoded data in a JqPlot Chart within a PHP script

I've spent the past few days scouring through Stack Overflow and various other websites, but I haven't been able to find a solution to my specific issue. Even the book 'Create Web Charts with JqPlot' by Fabio Nelli didn't provide t ...

The error message "React Native Redux useSelector is returning Undefined after navigation" has

After navigating to a new state, I am facing issues with accessing the updated state. Initially, I initialize my dataState in the reducer and update it using actions. On Screen 1, I successfully use this state after dispatching, but when moving to another ...

Loop through a collection of arrays that contain the same elements, and multiply each consecutive element by a specified value x

I've been diving into a challenging problem involving remarkable numbers, which are defined as A number that is equal to the sum of all its proper divisors -- provided one of them is negative. For instance, the proper divisors of 12 are 1, 2, 3, 4, 6 ...

Determining when a message has been ignored using php

One of the features I am working on for my app is adding announcements, which are essentially personalized messages to users. Once a user receives a message and dismisses it, I want to ensure that specific message does not appear again. Here is the PHP co ...

Storing an object with the same value in AngularJS

Having an issue with pushing objects into an array using AngularJS. The problem is that it keeps storing the same value in every object, as it is an associative object. service('setAttribs',function(){ var setMapAttrib = { Processtet : {}, ...

Acquiring a data structure in the form of either an array list or a

As I attempt to establish a connection between an app and an external service, I receive either an array like [{"descr":"my description","id":"123"},...] or in case of an error, something like {"error":{"code":123,"message":"my message"}} Is it possi ...

Output the contents of a nested object

After setting up a variable containing music library data... var library = { tracks: { t01: { id: "t01", name: "Code Monkey", artist: "Jonathan Coulton", album: "Thing a Week Three" }, t02: { id: " ...

Why does the Node.js REST API keep throwing errors after I try to create just one record?

I encountered a back end issue recently. I have developed a simple API with just a post endpoint. The intention is to post data using the req.body. Oddly enough, it works perfectly fine the first time but when I attempt it again, I receive an error message ...

The basic evaluation of jQuery elements does not result in a comparison

Wondering what's going wrong in this code: employee_ids = $('[data-employee_id="'+employee+'"]'); timestamp_ids = $('[data-scheduled_on="'+timestamp+'"]'); var common = $.grep(timestamp_ids, function(element) ...

Implementation of internationalization into a JSON-formatted data file

I recently integrated i18n into my application and I'm facing a challenge with implementing the useTranslation(); function in my navbar data file. This file serves as the database for the page titles and tabs, and I'm unsure about how to proceed. ...

Why is the React Redux child component unable to access props?

Struggling with React and Redux? Here's the issue: A Component in my project is supposed to receive a value from Redux using mapStateToProps. The problem arises when trying to access this value within the child Component's renderFoo() function. ...

What is the process for registering a click using a class in jQuery and retrieving the ID of the clicked element?

Currently, I am working on developing a webpage where I need to use jQuery to register a click using the items class and then extract the ID of that particular object. For example: HTML: <div class="exampleclass" id="exampleid1"></div> <d ...

`The best way to access a JavaScript variable from PHP`

This is the code snippet I am working on: var daaa=document.getElementById('da').value= year+ "-" +month+ "-" +day; document.form1.bookingsession.focus(); var coords = { "lat": daaa }; $.get('bs.php', coords, function () { ...

Is there a way to retrieve JSON data from a different domain and incorporate it into my own website?

I am attempting to utilize JSON data from "" and display the data on my website. My goal is to extract the JSON field name "Stats" and retrieve the sub-field name '\"v\"'. You can refer to the documentation provided by purpleair here: h ...