Skip to content

Instantly share code, notes, and snippets.

@kevinwhoffman
Created January 31, 2018 04:25
Show Gist options
  • Select an option

  • Save kevinwhoffman/b6fb08d69043523f0487c2179718f569 to your computer and use it in GitHub Desktop.

Select an option

Save kevinwhoffman/b6fb08d69043523f0487c2179718f569 to your computer and use it in GitHub Desktop.

Revisions

  1. kevinwhoffman created this gist Jan 31, 2018.
    16 changes: 16 additions & 0 deletions zap.js
    Original 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);