I'm writing a gmail addon with appscript and I want it to perform an http request only when the addon is opened by an user, instead of everytime the card is rendered.
function main(e){
var mainCard = CardService.newCardBuilder();
// Set up card sections
UrlFetchApp.fetch(...) // Will perform the request even if addon is not opened
return [card.build()]
}
Is it possible, to execute UrlFetchApp on card open instead of on render?