Google Apps Script Library for Gmail API

The Gmail API offers extra functionality not available inside the Gmail service of Google Apps Script. For instance, the ability to purge Gmail folders is available in Apps Script but there’s no option to empty the trash. This can be easily done with the Gmail API. It also support draft creation that is used in Gmail Merge.

Spencer has published a wrapper library that makes it easy to use the Gmail API inside Google Apps Script.