3.0.1 • Published 7 years ago

moosend-api v3.0.1

Weekly downloads
8
License
MIT
Repository
github
Last release
7 years ago

Moosend Javascript Wrapper

The following project is a Javascript implementation of the Moosend V3 API. You can find the API documentation at http://docs.moosendapp.apiary.io/#

Installation

npm install moosend-api --save

Getting Started

Please follow the installation instruction and execute the following JS code:

var MoosendApi = require('moosend-api');

var api = new MoosendApi.CampaignsApi()

var format = "format_example"; // {String} 

var apikey = "apikey_example"; // {String} You may find your API Key or generate a new one in your account settings.

var campaignID = "campaignID_example"; // {String} The ID of the requested AB test campaign


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.aBTestCampaignSummary(format, apikey, campaignID, callback);

Documentation for API Endpoints

CampaignsApi

ClassMethod
GetAllCampaignsReturns a list of all campaigns in your account with detailed information.
GetCampaignsByPageReturns a list of all campaigns in your account with detailed information, paging information is required as input.
GetCampaignsByPageAndPagesizeReturns a list of all campaigns in your account with detailed information, paging information is required as input.
GettingCampaignDetailsReturns a complete set of properties that describe the requested campaign in detail.
GettingSenderDetailsReturns basic information for the specified sender identified by its email address.
CloningAnExistingCampaignCreates an exact copy of an existing campaign. The new campaign is created as a draft.
CreatingADraftCampaignCreates a new campaign in your account. This method does not send the campaign, but rather creates it as a draft, ready for sending or testing.
UpdatingADraftCampaignUpdates properties of an existing draft A/B campaign in your account. Non-draft campaigns cannot be updated.
DeletingACampaignDeletes a campaign from your account, draft or even sent.
TestingACampaignSends a test email of a draft campaign to a list of email addresses you specify for previewing.
SendingACampaignSends an existing draft campaign to all recipients specified in its mailing list. The campaign is sent immediatelly.
ABTestCampaignSummaryProvides a basic summary of the results for a sent AB test campaign, separately for each version (A and B), such as the number of recipients, opens, clicks, bounces, unsubscribes, forwards etc to date.
ActivityByLocationReturns a detailed report of your campaign opens (unique and total) by country.
CampaignSummaryProvides a basic summary of the results for any sent campaign such as the number of recipients, opens, clicks, bounces, unsubscribes, forwards etc. to date.
GettingAllYourSendersGets a list of your active senders in your account. You may specify any email address of these senders when sending a campaign.
LinkActivityReturns a list with your campaign links and how many clicks have been made by your recipients, either unique or total.
SchedulingACampaignAssigns a scheduled date and time at which the campaign will be delivered.
UnschedulingACampaignRemoves a previously defined scheduled date and time from a campaign, so that it will be delivered immediately if already queued or when sent.

MailingListsApi

ClassMethod
CreatingACustomFieldCreates a new custom field in the specified mailing list.
CreatingAMailingListCreates a new empty mailing list in your account.
DeletingAMailingListDeletes a mailing list from your account.
GettingAllActiveMailingListsGets a list of your active mailing lists in your account.
GettingAllActiveMailingListsWithPagingGets a list of your active mailing lists in your account. Because the results for this call could be quite big, paging information is required as input.
GettingMailingListDetailsGets details for a given mailing list. You may include subscriber statistics in your results or not. Any segments existing for the requested mailing list will not be included in the results.
RemovingACustomFieldRemoves a custom field definition from the specified mailing list.
UpdatingACustomFieldUpdates the properties of an existing custom field in the specified mailing list.
UpdatingAMailingListUpdates the properties of an existing mailing list.

SegmentsApi

ClassMethod
GettingSegmentsGet a list of all segments with their criteria for the given mailing list.
GettingSegmentDetailsGets detailed information on a specific segment and its criteria. However, it does not include the subscribers returned by the segment.
GettingSegmentSubscribersGets a list of the subscribers that the specified segment returns according to its criteria. Because the results for this call could be quite big, paging information is required as input.
CreatingANewSegmentCreates a new empty segment (without criteria) for the given mailing list. You may specify the name of the segment and the way the criteria will match together.
UpdatingASegmentUpdates the properties of an existing segment. You may update the name and match type of the segment.
AddingCriteriaToSegmentsAdds a new criterion (a rule) to the specified segment.
UpdatingSegmentCriteriaUpdates an existing criterion in the specified segment.
DeletingASegmentDeletes a segment along with its criteria from the mailing list. The subscribers of the mailing list that the segment returned are not deleted or affected in any way.

SubscribersApi

ClassMethod
GettingSubscribersGets a list of all subscribers in a given mailing list. You may filter the list by setting a date to fetch those subscribed since then and/or by their status.
GetSubscriberByEmailAddressSearches for a subscriber with the specified email address in the specified mailing list.
GetSubscriberByIdSearches for a subscriber with the specified unique id in the specified mailing list
AddingSubscribersAdds a new subscriber to the specified mailing list. If there is already a subscriber with the specified email address in the list, an update will be performed instead.
AddingMultipleSubscribersThis method allows you to add multiple subscribers in a mailing list with a single call. If some subscribers already exist with the given email addresses, they will be updated.
UpdatingASubscriberUpdates a subscriber in the specified mailing list. You can even update the subscribers email, if he has not unsubscribed.
UnsubscribingSubscribersFromAccountUnsubscribes a subscriber from the account.
UnsubscribingSubscribersFromMailingListUnsubscribes a subscriber from the specified mailing list. The subscriber is not deleted, but moved to the suppression list.
UnsubscribingSubscribersFromMailingListAndASpecifiedCampaignUnsubscribes a subscriber from the specified mailing list and the specified campaign. The subscriber is not deleted, but moved to the suppression list.
RemovingASubscriberRemoves a subscriber from the specified mailing list permanently (without moving to the suppression list).
RemovingMultipleSubscribersRemoves a list of subscribers from the specified mailing list permanently (without putting them in the suppression list). Any invalid email addresses specified will be ignored.

Documentation for Models