0.1.1 • Published 8 years ago

mongodb-js-intercom v0.1.1

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
8 years ago

intercom-api-wrapper travis npm

Light wrapper around intercom.io's API requests to abstract out intercom-specific methods

Install

npm install mongodb-js-intercom
var intercom = require('mongodb-js-intercom');

Example

The wrapper exposes three basic functions getUsers, getUsersBySegment, and getCount.

getUsers(<lastNumDays>, callback);

getUsers returns a list of users. Expects an integer for lastNumDays and a callback - lastNumDays limits the return results to only users created in the last lastNumDays days, omit this parameter to get all users ever created.

getUsersBySegment(<segment>, callback);

getUsersBySegment returns a list of users that are in a specified segment. Expects a string for segment and a callback - segment should be an existing segment in Intercom.

getCount(<type>, <count>, callback);

getCount returns a list of key + count pairs, Expects a string for type and count and a callback - type determines the unit of grouping (company, segment, tag, users) and count determines how to bucket the units

License

Apache 2.0