Tags down


Make http request on gmail addon when card is opened

By : Tara Lynn Stephens
Date : October 14 2020, 02:21 PM
around this issue According to the documentation, you cannot create or use Apps Script simple nor installable triggers in a Gmail add-on.
However, you can try looking into time-driven triggers as a workaround.
code :

Share : facebook icon twitter icon

How to make PUT request (cross domain request) using Request object of firefox addon-sdk

By : NihalShah
Date : March 29 2020, 07:55 AM
Does that help No, the request package only supports GET or POST - method PUT is pretty much non-existent on the web and I guess that supporting it made no sense. You would need to use the internal xhr package that mostly provides the API of a regular XMLHttpRequest object:
code :
var {XMLHttpRequest} = require(xhr);
var request = new XMLHttpRequest();
request.open("PUT", "http://example.com/");
request.onreadystatechange = function()
  if (request.readyState == 4)
    console.log("request done");

How to make an HTTP POST request in Gmail Contextual Gadget?

By : Behzad B.
Date : March 29 2020, 07:55 AM
around this issue I’m developing a Gmail Contextual Gadget and now I’m faced with a Post Http communication problem. I don’t have any problem with get request, here’s is my get request code: , use gadgets.io.encodeValues to set POST_DATA
code :
params[gadgets.io.RequestParameters.POST_DATA] = gadgets.io.encodeValues(postdata);
 params[gadgets.io.RequestParameters.POST_DATA] = gadgets.io.encodeValues({
            Gadget_Post_DATA: gadgets.json.stringify(mydata)

How to login into Gmail to make an HTTP request using Google AppScript

By : Pulakesh Dhara
Date : March 29 2020, 07:55 AM
around this issue I have the following code to erase some drafts using the method described here using a HTTP request: , You need to send an authorization header in your request like so:
code :
//Code above this remains the same
    var userId = 'kurokirasama@gmail.com';   
      var options = {
       'headers':{'Authorization': 'Bearer ' + ScriptApp.getOAuthToken()},
       'method' : 'DELETE',
       'muteHttpExceptions': true
//the code below remains the same
function cleanUp2() {
  var threads = GmailApp.search("in:trash is:draft");

  var userId = 'kurokirasama@gmail.com';

  for (var i = 0; i < threads.length; i++) {
    var messages = threads[i].getMessages();

    for (var j = 0; j < messages.length; j++){
      if (messages[j].isDraft()){
        Logger.log('id msg: ' + messages[j].getId());
        Gmail.Users.Messages.trash(userId, messages[j].getId())

HTTP failure callback for UrlFetchApp.fetch() in gmail addon

By : user909437
Date : March 29 2020, 07:55 AM
To fix the issue you can do Please note that the fetch function is synchronous. It does not provide a callback parameter and does not return a promise.
An approach to catching exceptions is possible through the UrlFetchApp.fetch(url, params) function. You can pass the muteHttpExceptions parameter into the params location of the function call. That way you can inspect the response code yourself and respond appropriately. Documentation: https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app#fetchurl-params
code :
UrlFetchApp.fetch('http://www.google.com/', {muteHttpExceptions: true});
try {
catch(e) {
   // e contains error response

how to make a gmail addon which works without opening the email message like task and calendar

By : mustapha
Date : October 08 2020, 10:00 AM
seems to work fine According to the documentation , Gmail add-ons that you have installed automatically appear in the Gmail user interface when you open or compose a message. The only triggers that are available for Gmail addon are contextualTriggers that is triggered when a message is opened and composeTrigger that is opened from Gmail compose interface. You can refer to this.
Privacy Policy - Terms - Contact Us © voile276.org