Created
January 31, 2018 04:25
-
-
Save kevinwhoffman/b6fb08d69043523f0487c2179718f569 to your computer and use it in GitHub Desktop.
Revisions
-
kevinwhoffman created this gist
Jan 31, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ 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);