Skip to content

Instantly share code, notes, and snippets.

@kevinwhoffman
Created January 31, 2018 04:25
Show Gist options
  • Save kevinwhoffman/b6fb08d69043523f0487c2179718f569 to your computer and use it in GitHub Desktop.
Save kevinwhoffman/b6fb08d69043523f0487c2179718f569 to your computer and use it in GitHub Desktop.
Hourly Help Scout Unassigned Alert
fetch('https://api.helpscout.net/v1/mailboxes/{YOUR_MAILBOX_ID}/folders.json', {
headers: {
"Authorization": "Basic {YOUR_HELP_SCOUT_API_KEY}"
}
})
.then(function (res) {
return res.json();
})
.then(function (body) {
var output = {
name: body.items[0].name, // Returns 'Unassigned'
totalCount: body.items[0].totalCount // Returns int
};
callback(null, output);
})
.catch(callback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment