title: Access back-end messages (not the one from the event)
body: <p>I once wrote a GMail widget that I had to convert to a Chrome add-on when Google removed support for the GMail widget, and I'm now trying to convert it to a Gmail Add-on.</p>
  
  <p>My issue is that my add-on loops thru a series of messages under a label and tries to reply to them, but I get a error trying to access them:</p>
  
  <blockquote>
    <p>ERROR: Exception: Access denied: : Missing access token for per message scope authorization.</p>
  </blockquote>
  
  <p>So my question is, how can I access those messages? The only access token I have is the one that triggered the add-on and that won't do.</p>
  
  <p>Or asking from a different point of view, are there more events that can trigger the add-on besides opening a message?</p>
  
  <p>Thanks in advance.</p>
  
  <p>BTW, the Chrome extension that I'm trying to convert to a Gmail add-on can be seen here:</p>
  
  <p><a href="https://sites.google.com/site/replytomany/home" rel="nofollow noreferrer">https://sites.google.com/site/replytomany/home</a></p>
  
  <p><a href="https://chrome.google.com/webstore/detail/reply-to-many/gpmpcjkhfjflmjpjjmdegpkgginijbin?hl=en" rel="nofollow noreferrer">https://chrome.google.com/webstore/detail/reply-to-many/gpmpcjkhfjflmjpjjmdegpkgginijbin?hl=en</a></p>
  
  <p>[EDIT] This is what my appsscript.json looks like:</p>
  
  <pre><code>{
    "timeZone": "Europe/Dublin",
    "dependencies": {
      "enabledAdvancedServices": [{
        "userSymbol": "Gmail",
        "serviceId": "gmail",
        "version": "v1"
      }]
    },
    "oauthScopes": [
              "https://www.googleapis.com/auth/gmail.addons.execute", 
              "https://www.googleapis.com/auth/gmail.readonly",
              "https://www.googleapis.com/auth/gmail.send"
           ],
    "gmail": {
      "name": "Reply To Many",
      "logoUrl": "https://www.gstatic.com/images/icons/material/system/1x/receipt_black_24dp.png",
      "contextualTriggers": [{
        "unconditional": {
        },
        "onTriggerFunction": "getContextualAddOn"
      }],
      "primaryColor": "#41f470",
      "secondaryColor": "#94f441",
      "version": "TRUSTED_TESTER_V2"
    }
  }
  </code></pre>