Created
January 31, 2018 04:25
-
-
Save kevinwhoffman/b6fb08d69043523f0487c2179718f569 to your computer and use it in GitHub Desktop.
Hourly Help Scout Unassigned Alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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