reachmailnj aims to provide a simple client library for interacing with the ReachMail API.
- node v0.6+
This wrapper provides a number of convenience functions for working with various API services. Each convenience function is named after the section and service it accesses, e.g. administrationAddresses() accesses /administration/addresses. Convenience functions will require at least a callback function and in most cases, parameters representing your account information and service request details. A complete list of the convenience functions is included below.
Alternatively, the basic functions for 'GET', 'POST', 'PUT', and 'DELETE' have been provided if you would like to access the services directly. Refer to the "Function parameters" section below for an example. Documentation on the required parameters for each service can be found in the ReachMail API documentation.
Note that at this time the client library supports only token authentication. For more information, refer to these instructions on creating a token.
To install the wrapper via npm:
$mkdir MyApplication
$cd MyApplication
$npm install reachmailapi
Or clone the full repository and copy the NodeJS wrapper to your application directory:
$git clone git@github.com:ReachmailInc/WebAPISamples.git
$mkdir MyApplication
$cp WebAPISamples/nodejs/reachmailapi.js MyApplication
var reachmail = require('reachmailapi');
var api = new reachmail({token: 'your_token_here'});
-
get(serviceUrl, callback())
api.get('/administration/users/current', function (httpCode, response) { console.log(httpCode); console.log(response); });
-
post(serviceUrl, postBody, callback())
api.post('/lists/filtered/00000000-0000-0000-0000-000000000000', {'LargerThan': 500}, function (httpCode, response) { console.log(httpCode); console.log(response); });
-
put(serviceUrl, postBody, callback())
api.put('/lists/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000', {'Name': 'New list name'}, function (httpCode, response) { console.log(httpCode); console.log(response); });
-
delete(serviceUrl, callback())
api.delete('lists/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000', function (httpCode, response) { console.log(httpCode); console.log(response); });
All convenience functions are listed here along with their required parameters, each one is linked to it's corresponding service documentation.
administrationUsersCurrent(callback)
administrationAddresses(AccountId, callback)
campaigns(AccountId, callback)
campaignsMessageTesting(AccountId, callback)
dataUpload(Request, callback)
dataDownload(dataid, callback)
easySmtpDelivery(AccountId, Request, callback)
listsCreate(AccountId, Request, callback)
listsInformation(AccountId, ListId, callback)
listsModify(AccountId, ListId, Request, callback)
listsDelete(AccountId, ListId, callback)
listsExport(AccountId, ListId, Request, callback)
listsExportStatus(AccountId, exportid, callback)
listsFields(accoutid, callback)
listsFiltered(AccountId, Request, callback)
listsGroupCreate(AccountId, Request, callback)
listsGroupInformation(AccountId, GroupId, callback)
listsGroupModify(AccountId, GroupId, Request, callback)
listsGroupDelete(AccountId, GroupId, callback)
listsImport(AccountId, ListId, Request, callback)
listsImportStatus(AccountId, importid, callback)
listsOptOut(AccountId, ListId, Request, callback)
listsRecipientsCreate(AccountId, ListId, Request, callback)
listsRecipientsInformation(AccountId, ListId, email, callback)
listsRecipientsDelete(AccountId, ListId, email, callback)
listsRecipientsModify(AccountId, ListId, email, callback)
listsRecipientsFiltered(AccountId, ListId, Request, callback)
listsRecipientsFilteredDelete(AccountId, ListId, callback)
listsRecipientsFilteredModify(AccountId, ListId, Request, callback)
listsRecipientsFilteredSubscribe(AccountId, ListId, Request, callback)
listsSubscriptionForm(AccountId, formid, callback)
listsSubscriptionFormFiltered(AccountId, callback)
mailingsCreate(AccountId, Request, callback)
mailingsInformation(AccountId, MailingId, callback)
mailingsModify(AccountId, MailingId, Request, callback)
mailingsDelete(AccountId, MailingId, callback)
mailingsFiltered(AccountId, Request, callback)
mailingsGroups(AccountId, callback)
mailingsGroupsCreate(AccountId, Request, callback)
mailingsGroupsInformation(AccountId, GroupId, callback)
mailingsGroupsModify(AccountId, GroupId, Request, callback)
mailingsGroupsDelete(AccountId, GroupId, callback)
reportsMailingsBouncesDetail(AccountId, MailingId, Request, callback)
reportsMailingsDetail(AccountId, MailingId, Request, callback)
reportsMailingsDetailInformation(AccountId, MailingId, callback)
reportsMailingsMessageTesting(AccountId, Request, callback)
reportsMailingsOpensDetail(AccountId, MailingId, Request, callback)
reportsMailingsOptOutsDetail(AccountId, MailingId, Request, callback)
reportsMailingsTrackedLinksDetail(AccountId, MailingId, Request, callback)
reportsMailingsTrackedLinksSummary(AccountId, MailingId, callback)
reportsMailingsTrackedLinksSummaryList = function(AccountId, MailingId, ListId, callback)
reportsEasySmtp(AccountId, StartDate, EndDate, callback)
reportsEasySmtpBounces(AccountId, StartDate, EndDate, callback)
reportsEasySmtpOptouts(AccountId, StartDate, EndDate, callback)
reportsEasySmtpOpens(AccountId, StartDate, EndDate, callback)
reportsEasySmtpClicks(AccountId, StartDate, EndDate, callback)
Questions regarding use of this software should be referred to support@reachmail.com