Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR GDSCRIPT

GAScript - Google Sheets - QBO API - Consent Dialogue Box

function doGet(e) {
  // change this to whatever store & credentials name are being used
  var goa = cGoa.GoaApp.createGoa ('Quickbooks',PropertiesService.getScriptProperties()).execute(e);
  
  // it's possible that we need consent - this will cause a consent dialog
  if (goa.needsConsent()) {
    return goa.getConsent();
  }
  
  // if we get here its time for your webapp to run and we should have a token, or thrown an error somewhere
  if (!goa.hasToken()) throw 'something went wrong with goa - did you check if consent was needed?';
  
  // This is a webapp doing whaever its supposed to do
  // now return it as normal
  return HtmlService.createHtmlOutput ("You're good to go and this webapp is no longer needed")
    .setSandboxMode(HtmlService.SandboxMode.IFRAME);
}
Source by ramblings.mcpher.com #
 
PREVIOUS NEXT
Tagged: #GAScript #Google #Sheets #QBO #API #Consent #Dialogue #Box
ADD COMMENT
Topic
Name
3+9 =