npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

dasddewqe

v1.2.333

Published

Clicksend v3 API

Readme

Getting started

Clicksend v3 API

How to Build

The generated SDK relies on Node Package Manager (NPM) being available to resolve dependencies. If you don't already have NPM installed, please go ahead and follow instructions to install NPM from here. The SDK also requires Node to be installed. If Node isn't already installed, please install it from here

NPM is installed by default when Node is installed

To check if node and npm have been successfully installed, write the following commands in command prompt:

  • node --version
  • npm -version

Version Check

Now use npm to resolve all dependencies by running the following command in the root directory (of the SDK folder):

npm install

Resolve Dependencies

Resolve Dependencies

This will install all dependencies in the node_modules folder.

Once dependencies are resolved, you will need to move the folder ClickSend in to your node_modules folder.

How to Use

The following section explains how to use the library in a new project.

1. Open Project Folder

Open an IDE/Text Editor for JavaScript like Sublime Text. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.

Click on File and select Open Folder.

Open Folder

Select the folder of your SDK and click on Select Folder to open it up in Sublime Text. The folder will become visible in the bar on the left.

Open Project

2. Creating a Test File

Now right click on the folder name and select the New File option to create a new test file. Save it as index.js Now import the generated NodeJS library using the following lines of code:

var lib = require('lib');

Save changes.

Create new file

Save new file

3. Running The Test File

To run the index.js file, open up the command prompt and navigate to the Path where the SDK folder resides. Type the following command to run the file:

node index.js

Run file

How to Test

These tests use Mocha framework for testing, coupled with Chai for assertions. These dependencies need to be installed for tests to run. Tests can be run in a number of ways:

Method 1 (Run all tests)

  1. Navigate to the root directory of the SDK folder from command prompt.
  2. Type mocha --recursive to run all the tests.

Method 2 (Run all tests)

  1. Navigate to the ../test/Controllers/ directory from command prompt.
  2. Type mocha * to run all the tests.

Method 3 (Run specific controller's tests)

  1. Navigate to the ../test/Controllers/ directory from command prompt.
  2. Type mocha ClickSend v3 APIController to run all the tests in that controller file.

To increase mocha's default timeout, you can change the TEST_TIMEOUT parameter's value in TestBootstrap.js.

Run Tests

Initialization

Authentication

In order to setup authentication in the API client, you need the following information.

| Parameter | Description | |-----------|-------------| | username | your username | | key | your api key |

API client can be initialized as following:

const lib = require('lib');

// Configuration parameters and credentials
lib.Configuration.username = "username"; // your username
lib.Configuration.key = "key"; // your api key

Class Reference

List of Controllers

Class: CountriesController

Get singleton instance

The singleton instance of the CountriesController class can be accessed from the API Client.

var controller = lib.CountriesController;

Method: getCountries

Tags: Skips Authentication

Get all countries

function getCountries(callback)

Example Usage



    controller.getCountries(function(error, response, context) {

    
    });

Back to List of Controllers

Class: SMSController

Get singleton instance

The singleton instance of the SMSController class can be accessed from the API Client.

var controller = lib.SMSController;

Method: sendSms

Send one or more SMS messages

function sendSms(smsMessages, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | smsMessages | Required | SmsMessageCollection model |

Example Usage


    var smsMessages = new SmsMessageCollection({"key":"value"});

    controller.sendSms(smsMessages, function(error, response, context) {

    
    });

Method: calculatePrice

Calculate sms price

function calculatePrice(smsMessages, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | smsMessages | Required | SmsMessageCollection model |

Example Usage


    var smsMessages = new SmsMessageCollection({"key":"value"});

    controller.calculatePrice(smsMessages, function(error, response, context) {

    
    });

Method: exportHistory

Export all sms history

function exportHistory(filename, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | filename | Required | Filename to download history as |

Example Usage


    var filename = 'filename';

    controller.exportHistory(filename, function(error, response, context) {

    
    });

Method: createReceipt

Add a delivery receipt

function createReceipt(url, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | url | Required | Your url |

Example Usage


    var url = 'url';

    controller.createReceipt(url, function(error, response, context) {

    
    });

Method: markReceiptsAsRead

Marked delivery receipts as read

function markReceiptsAsRead(dateBefore, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | dateBefore | Optional | Mark all as read before this timestamp |

Example Usage


    var dateBefore = date_before;

    controller.markReceiptsAsRead(dateBefore, function(error, response, context) {

    
    });

Method: getInboundSms

Get all inbound sms

function getInboundSms(callback)

Example Usage



    controller.getInboundSms(function(error, response, context) {

    
    });

Method: createInboundSms

Create inbound sms

function createInboundSms(url, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | url | Required | Your url |

Example Usage


    var url = 'url';

    controller.createInboundSms(url, function(error, response, context) {

    
    });

Method: cancelScheduledSms

Update scheduled message as cancel

function cancelScheduledSms(messageId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | messageId | Required | The message ID you want to cancel |

Example Usage


    var messageId = message_id;

    controller.cancelScheduledSms(messageId, function(error, response, context) {

    
    });

Method: cancelAllScheduledSms

Update all scheduled message as cancelled

function cancelAllScheduledSms(callback)

Example Usage



    controller.cancelAllScheduledSms(function(error, response, context) {

    
    });

Method: createSmsTemplate

Create sms template

function createSmsTemplate(smsTemplate, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | smsTemplate | Required | SmsTemplate model |

Example Usage


    var smsTemplate = new SmsTemplate({"key":"value"});

    controller.createSmsTemplate(smsTemplate, function(error, response, context) {

    
    });

Method: deleteSmsTemplate

Delete sms template

function deleteSmsTemplate(templateId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | templateId | Required | Template id |

Example Usage


    var templateId = 155;

    controller.deleteSmsTemplate(templateId, function(error, response, context) {

    
    });

Method: updateSmsTemplate

Update sms template

function updateSmsTemplate(templateId, smsTemplate, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | templateId | Required | Template id | | smsTemplate | Required | Template item |

Example Usage


    var templateId = 155;
    var smsTemplate = new SmsTemplate({"key":"value"});

    controller.updateSmsTemplate(templateId, smsTemplate, function(error, response, context) {

    
    });

Method: getDeliveryReceipts

Get all delivery receipts

function getDeliveryReceipts(callback)

Example Usage



    controller.getDeliveryReceipts(function(error, response, context) {

    
    });

Method: getSmsTemplates

Get lists of all sms templates

function getSmsTemplates(callback)

Example Usage



    controller.getSmsTemplates(function(error, response, context) {

    
    });

Method: markAllInboundSMSAsRead

Mark all inbound SMS as read optionally before a certain date

function markAllInboundSMSAsRead(dateBefore, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | dateBefore | Optional | An optional timestamp - mark all as read before this timestamp. If not given, all messages will be marked as read. |

Example Usage


    var dateBefore = date_before;

    controller.markAllInboundSMSAsRead(dateBefore, function(error, response, context) {

    
    });

Method: getSpecificDeliveryReceipt

Get a Specific Delivery Receipt

function getSpecificDeliveryReceipt(messageId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | messageId | Required | Message ID |

Example Usage


    var messageId = message_id;

    controller.getSpecificDeliveryReceipt(messageId, function(error, response, context) {

    
    });

Method: getSmsHistory

Get all sms history

function getSmsHistory(dateFrom, dateTo, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | dateFrom | Optional | Start date | | dateTo | Optional | End date |

Example Usage


    var dateFrom = 155;
    var dateTo = 155;

    controller.getSmsHistory(dateFrom, dateTo, function(error, response, context) {

    
    });

Back to List of Controllers

Class: VoiceController

Get singleton instance

The singleton instance of the VoiceController class can be accessed from the API Client.

var controller = lib.VoiceController;

Method: sendVoice

Send a voice call

function sendVoice(voiceMessages, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | voiceMessages | Required | VoiceMessageCollection model |

Example Usage


    var voiceMessages = new VoiceMessageCollection({"key":"value"});

    controller.sendVoice(voiceMessages, function(error, response, context) {

    
    });

Method: calculatePrice

Calculate voice price

function calculatePrice(voiceMessages, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | voiceMessages | Required | VoiceMessageCollection model |

Example Usage


    var voiceMessages = new VoiceMessageCollection({"key":"value"});

    controller.calculatePrice(voiceMessages, function(error, response, context) {

    
    });

Method: getVoiceLanguages

Get all voice languages

function getVoiceLanguages(callback)

Example Usage



    controller.getVoiceLanguages(function(error, response, context) {

    
    });

Method: getVoiceReceipts

Get all voice receipts

function getVoiceReceipts(callback)

Example Usage



    controller.getVoiceReceipts(function(error, response, context) {

    
    });

Method: cancelVoiceMessage

Update voice message status as cancelled

function cancelVoiceMessage(messageId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | messageId | Required | Your voice message id |

Example Usage


    var messageId = message_id;

    controller.cancelVoiceMessage(messageId, function(error, response, context) {

    
    });

Method: cancelVoiceMessages

Update all voice messages as cancelled

function cancelVoiceMessages(callback)

Example Usage



    controller.cancelVoiceMessages(function(error, response, context) {

    
    });

Method: exportVoiceHistory

Export voice history

function exportVoiceHistory(filename, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | filename | Required | Filename to export to |

Example Usage


    var filename = 'filename';

    controller.exportVoiceHistory(filename, function(error, response, context) {

    
    });

Method: getVoiceHistory

Get all voice history

function getVoiceHistory(dateFrom, dateTo, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | dateFrom | Optional | Timestamp (from) used to show records by date. | | dateTo | Optional | Timestamp (to) used to show records by date |

Example Usage


    var dateFrom = 155;
    var dateTo = 155;

    controller.getVoiceHistory(dateFrom, dateTo, function(error, response, context) {

    
    });

Back to List of Controllers

Class: AccountController

Get singleton instance

The singleton instance of the AccountController class can be accessed from the API Client.

var controller = lib.AccountController;

Method: getAccount

Get account details

function getAccount(callback)

Example Usage



    controller.getAccount(function(error, response, context) {

    
    });

Method: createAccount

Create An Account

function createAccount(account, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | account | Required | Account model |

Example Usage


    var account = new Account({"key":"value"});

    controller.createAccount(account, function(error, response, context) {

    
    });

Method: accountVerifySend

Send account activation token

function accountVerifySend(accountVerify, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | accountVerify | Required | Account details |

Example Usage


    var accountVerify = new AccountVerify({"key":"value"});

    controller.accountVerifySend(accountVerify, function(error, response, context) {

    
    });

Method: accountVerify

Verify new account

function accountVerify(activationToken, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | activationToken | Required | TODO: Add a parameter description |

Example Usage


    var activationToken = 155;

    controller.accountVerify(activationToken, function(error, response, context) {

    
    });

Method: forgotUsername

Tags: Skips Authentication

Forgot username

function forgotUsername(email, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | email | Required | Email belonging to account |

Example Usage


    var email = 'email';

    controller.forgotUsername(email, function(error, response, context) {

    
    });

Method: forgotPassword

Forgot password

function forgotPassword(username, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | username | Required | Username belonging to account |

Example Usage


    var username = 'username';

    controller.forgotPassword(username, function(error, response, context) {

    
    });

Method: verifyForgotPassword

Verify forgot password

function verifyForgotPassword(verifyPassword, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | verifyPassword | Required | verifyPassword data |

Example Usage


    var verifyPassword = new AccountForgotPasswordVerify({"key":"value"});

    controller.verifyForgotPassword(verifyPassword, function(error, response, context) {

    
    });

Back to List of Controllers

Class: SubaccountController

Get singleton instance

The singleton instance of the SubaccountController class can be accessed from the API Client.

var controller = lib.SubaccountController;

Method: getSubaccounts

Get all subaccounts

function getSubaccounts(callback)

Example Usage



    controller.getSubaccounts(function(error, response, context) {

    
    });

Method: createSubaccount

Create new subaccount

function createSubaccount(subaccount, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subaccount | Required | Subaccount model |

Example Usage


    var subaccount = new Subaccount({"key":"value"});

    controller.createSubaccount(subaccount, function(error, response, context) {

    
    });

Method: getSubaccount

Get specific subaccount

function getSubaccount(subaccountId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subaccountId | Required | ID of subaccount to get |

Example Usage


    var subaccountId = 155;

    controller.getSubaccount(subaccountId, function(error, response, context) {

    
    });

Method: deleteSubaccount

Delete a subaccount

function deleteSubaccount(subaccountId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subaccountId | Required | ID of subaccount to delete |

Example Usage


    var subaccountId = 155;

    controller.deleteSubaccount(subaccountId, function(error, response, context) {

    
    });

Method: regenerateApiKey

Regenerate an API Key

function regenerateApiKey(subaccountId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subaccountId | Required | ID of subaccount to regenerate API key for |

Example Usage


    var subaccountId = 155;

    controller.regenerateApiKey(subaccountId, function(error, response, context) {

    
    });

Method: updateSubaccount

Update subaccount

function updateSubaccount(subaccountId, subaccount, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | subaccountId | Required | ID of subaccount to update | | subaccount | Required | Subaccount model |

Example Usage


    var subaccountId = 155;
    var subaccount = new Subaccount({"key":"value"});

    controller.updateSubaccount(subaccountId, subaccount, function(error, response, context) {

    
    });

Back to List of Controllers

Class: ContactListController

Get singleton instance

The singleton instance of the ContactListController class can be accessed from the API Client.

var controller = lib.ContactListController;

Method: getContactLists

Get all contact lists

function getContactLists(callback)

Example Usage



    controller.getContactLists(function(error, response, context) {

    
    });

Method: createContactList

Create new contact list

function createContactList(listName, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | listName | Required | Your contact list name |

Example Usage


    var listName = list_name;

    controller.createContactList(listName, function(error, response, context) {

    
    });

Method: getContactList

Get specific contact list

function getContactList(listId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | listId | Required | List ID |

Example Usage


    var listId = 155;

    controller.getContactList(listId, function(error, response, context) {

    
    });

Method: deleteContactList

Delete a specific contact list

function deleteContactList(listId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | listId | Required | List ID |

Example Usage


    var listId = 155;

    controller.deleteContactList(listId, function(error, response, context) {

    
    });

Method: removeDuplicateContacts

Remove duplicate contacts

function removeDuplicateContacts(listId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | listId | Required | Your list id |

Example Usage


    var listId = 155;

    controller.removeDuplicateContacts(listId, function(error, response, context) {

    
    });

Method: updateContactList

Update specific contact list

function updateContactList(listId, listName, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | listId | Required | Your list id | | listName | Required | Your new list name |

Example Usage


    var listId = 155;
    var listName = list_name;

    controller.updateContactList(listId, listName, function(error, response, context) {

    
    });

Method: importContactsToList

Import contacts to list

function importContactsToList(listId, file, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | listId | Required | Your contact list id you want to access. | | file | Required | ContactListImport model |

Example Usage


    var listId = 155;
    var file = new ContactListImport({"key":"value"});

    controller.importContactsToList(listId, file, function(error, response, context) {

    
    });

Back to List of Controllers

Class: ContactController

Get singleton instance

The singleton instance of the ContactController class can be accessed from the API Client.

var controller = lib.ContactController;

Method: getContacts

Get all contacts in a list

function getContacts(listId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | listId | Required | Contact list ID |

Example Usage


    var listId = 155;

    controller.getContacts(listId, function(error, response, context) {

    
    });

Method: createContact

Create new contact

function createContact(contact, listId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | contact | Required | Contact model | | listId | Required | List id |

Example Usage


    var contact = new Contact({"key":"value"});
    var listId = 155;

    controller.createContact(contact, listId, function(error, response, context) {

    
    });

Method: getContact

Get a specific contact

function getContact(listId, contactId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | listId | Required | Your contact list id you want to access. | | contactId | Required | Your contact id you want to access. |

Example Usage


    var listId = 155;
    var contactId = 155;

    controller.getContact(listId, contactId, function(error, response, context) {

    
    });

Method: updateContact

Update contact

function updateContact(listId, contactId, contact, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | listId | Required | Contact list id | | contactId | Required | Contact ID | | contact | Required | Contact model |

Example Usage


    var listId = 155;
    var contactId = 155;
    var contact = new Contact({"key":"value"});

    controller.updateContact(listId, contactId, contact, function(error, response, context) {

    
    });

Method: removeOptedOutContacts

Remove all opted out contacts

function removeOptedOutContacts(listId, optOutListId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | listId | Required | Your list id | | optOutListId | Required | Your opt out list id |

Example Usage


    var listId = 155;
    var optOutListId = 155;

    controller.removeOptedOutContacts(listId, optOutListId, function(error, response, context) {

    
    });

Method: deleteContact

Delete a contact

function deleteContact(listId, contactId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | listId | Required | List ID | | contactId | Required | Contact ID |

Example Usage


    var listId = 155;
    var contactId = 155;

    controller.deleteContact(listId, contactId, function(error, response, context) {

    
    });

Back to List of Controllers

Class: NumberController

Get singleton instance

The singleton instance of the NumberController class can be accessed from the API Client.

var controller = lib.NumberController;

Method: getDedicatedNumbers

Get all dedicated numbers

function getDedicatedNumbers(callback)

Example Usage



    controller.getDedicatedNumbers(function(error, response, context) {

    
    });

Method: purchaseDedicatedNumber

Buy dedicated number

function purchaseDedicatedNumber(dedicatedNumber, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | dedicatedNumber | Required | Phone number to purchase |

Example Usage


    var dedicatedNumber = dedicated_number;

    controller.purchaseDedicatedNumber(dedicatedNumber, function(error, response, context) {

    
    });

Method: getDedicatedNumbersByCountry

Get all dedicated numbers by country

function getDedicatedNumbersByCountry(country, search, searchType, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | country | Required | Country code to search | | search | Optional | Your search pattern or query. | | searchType | Optional | Your strategy for searching, 0 = starts with, 1 = anywhere, 2 = ends with. |

Example Usage


    var country = 'country';
    var search = 'search';
    var searchType = 155;

    controller.getDedicatedNumbersByCountry(country, search, searchType, function(error, response, context) {

    
    });

Back to List of Controllers

Class: StatisticsController

Get singleton instance

The singleton instance of the StatisticsController class can be accessed from the API Client.

var controller = lib.StatisticsController;

Method: getVoiceStatistics

Get voice statistics

function getVoiceStatistics(callback)

Example Usage



    controller.getVoiceStatistics(function(error, response, context) {

    
    });

Method: getSmsStatistics

Get sms statistics

function getSmsStatistics(callback)

Example Usage



    controller.getSmsStatistics(function(error, response, context) {

    
    });

Back to List of Controllers

Class: EmailToSmsController

Get singleton instance

The singleton instance of the EmailToSmsController class can be accessed from the API Client.

var controller = lib.EmailToSmsController;

Method: createAllowedAddress

Create email to sms allowed address

function createAllowedAddress(emailSmsAddress, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | emailSmsAddress | Required | EmailSMSAddress model |

Example Usage


    var emailSmsAddress = new EmailSMSAddress({"key":"value"});

    controller.createAllowedAddress(emailSmsAddress, function(error, response, context) {

    
    });

Method: getAllowedAddress

Get list of email to sms allowed addresses

function getAllowedAddress(callback)

Example Usage



    controller.getAllowedAddress(function(error, response, context) {

    
    });

Back to List of Controllers

Class: SearchController

Get singleton instance

The singleton instance of the SearchController class can be accessed from the API Client.

var controller = lib.SearchController;

Method: searchContactList

Get list of searched contact list

function searchContactList(q, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | q | Required | Your keyword or query. |

Example Usage


    var q = 'q';

    controller.searchContactList(q, function(error, response, context) {

    
    });

Back to List of Controllers

Class: ReferralAccountController

Get singleton instance

The singleton instance of the ReferralAccountController class can be accessed from the API Client.

var controller = lib.ReferralAccountController;

Method: getReferralAccounts

Get all referral accounts

function getReferralAccounts(callback)

Example Usage



    controller.getReferralAccounts(function(error, response, context) {

    
    });

Back to List of Controllers

Class: ResellerAccountController

Get singleton instance

The singleton instance of the ResellerAccountController class can be accessed from the API Client.

var controller = lib.ResellerAccountController;

Method: getResellerAccounts

Get list of reseller accounts

function getResellerAccounts(callback)

Example Usage



    controller.getResellerAccounts(function(error, response, context) {

    
    });

Method: createResellerAccount

Create reseller account

function createResellerAccount(resellerAccount, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | resellerAccount | Required | ResellerAccount model |

Example Usage


    var resellerAccount = new ResellerAccount({"key":"value"});

    controller.createResellerAccount(resellerAccount, function(error, response, context) {

    
    });

Method: getResellerAccount

Get Reseller Account

function getResellerAccount(clientUserId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | clientUserId | Required | User ID of client |

Example Usage


    var clientUserId = 155;

    controller.getResellerAccount(clientUserId, function(error, response, context) {

    
    });

Method: updateResellerAccount

Reseller Account

function updateResellerAccount(clientUserId, resellerAccount, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | clientUserId | Required | User ID of client | | resellerAccount | Required | ResellerAccount model |

Example Usage


    var clientUserId = 155;
    var resellerAccount = new ResellerAccount({"key":"value"});

    controller.updateResellerAccount(clientUserId, resellerAccount, function(error, response, context) {

    
    });

Back to List of Controllers

Class: TransferCreditController

Get singleton instance

The singleton instance of the TransferCreditController class can be accessed from the API Client.

var controller = lib.TransferCreditController;

Method: transferCredit

Transfer Credit

function transferCredit(resellerAccountTransferCredit, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | resellerAccountTransferCredit | Required | ResellerAccountTransferCredit model |

Example Usage


    var resellerAccountTransferCredit = new ResellerAccountTransferCredit({"key":"value"});

    controller.transferCredit(resellerAccountTransferCredit, function(error, response, context) {

    
    });

Back to List of Controllers

Class: AccountRechargeController

Get singleton instance

The singleton instance of the AccountRechargeController class can be accessed from the API Client.

var controller = lib.AccountRechargeController;

Method: getCreditCardInfo

Get Credit Card info

function getCreditCardInfo(callback)

Example Usage



    controller.getCreditCardInfo(function(error, response, context) {

    
    });

Method: updateCreditCardInfo

Update credit card info

function updateCreditCardInfo(creditCard, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | creditCard | Required | CreditCard model |

Example Usage


    var creditCard = new CreditCard({"key":"value"});

    controller.updateCreditCardInfo(creditCard, function(error, response, context) {

    
    });

Method: getPackagesList

Get list of all packages

function getPackagesList(country, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | country | Optional | Country code |

Example Usage


    var country = 'country';

    controller.getPackagesList(country, function(error, response, context) {

    
    });

Method: purchasePackage

Purchase a package

function purchasePackage(packageId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | packageId | Required | ID of package to purchase |

Example Usage


    var packageId = 155;

    controller.purchasePackage(packageId, function(error, response, context) {

    
    });

Method: getTransactions

Get all transactions

function getTransactions(callback)

Example Usage



    controller.getTransactions(function(error, response, context) {

    
    });

Method: getTransaction

Get specific Transaction

function getTransaction(transactionId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | transactionId | Required | ID of transaction to retrieve |

Example Usage


    var transactionId = transaction_id;

    controller.getTransaction(transactionId, function(error, response, context) {

    
    });

Back to List of Controllers

Class: SmsCampaignController

Get singleton instance

The singleton instance of the SmsCampaignController class can be accessed from the API Client.

var controller = lib.SmsCampaignController;

Method: createSmsCampaign

Create sms campaign

function createSmsCampaign(campaign, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | campaign | Required | SmsCampaign model |

Example Usage


    var campaign = new SmsCampaign({"key":"value"});

    controller.createSmsCampaign(campaign, function(error, response, context) {

    
    });

Method: calculatePrice

Calculate price for sms campaign

function calculatePrice(campaign, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | campaign | Required | SmsCampaign model |

Example Usage


    var campaign = new SmsCampaign({"key":"value"});

    controller.calculatePrice(campaign, function(error, response, context) {

    
    });

Method: updateSmsCampaign

Update sms campaign

function updateSmsCampaign(smsCampaignId, campaign, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | smsCampaignId | Required | ID of SMS campaign to update | | campaign | Required | SmsCampaign model |

Example Usage


    var smsCampaignId = 247;
    var campaign = new SmsCampaign({"key":"value"});

    controller.updateSmsCampaign(smsCampaignId, campaign, function(error, response, context) {

    
    });

Method: cancelSmsCampaign

Cancel sms campaign

function cancelSmsCampaign(smsCampaignId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | smsCampaignId | Required | ID of SMS Campaign to cancel |

Example Usage


    var smsCampaignId = 247;

    controller.cancelSmsCampaign(smsCampaignId, function(error, response, context) {

    
    });

Method: getSmsCampaigns

Get list of sms campaigns

function getSmsCampaigns(callback)

Example Usage



    controller.getSmsCampaigns(function(error, response, context) {

    
    });

Method: getSmsCampaign

Get specific sms campaign

function getSmsCampaign(smsCampaignId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | smsCampaignId | Required | ID of SMS campaign to retrieve |

Example Usage


    var smsCampaignId = 247;

    controller.getSmsCampaign(smsCampaignId, function(error, response, context) {

    
    });

Back to List of Controllers

Class: PostLetterController

Get singleton instance

The singleton instance of the PostLetterController class can be accessed from the API Client.

var controller = lib.PostLetterController;

Method: sendPostLetter

Send post letter

function sendPostLetter(postLetter, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | postLetter | Required | PostLetter model |

Example Usage


    var postLetter = new PostLetter({"key":"value"});

    controller.sendPostLetter(postLetter, function(error, response, context) {

    
    });

Method: calculatePrice

Calculate post letter price

function calculatePrice(postLetter, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | postLetter | Required | PostLetter model |

Example Usage


    var postLetter = new PostLetter({"key":"value"});

    controller.calculatePrice(postLetter, function(error, response, context) {

    
    });

Method: getPostLetterHistory

Get all post letter history

function getPostLetterHistory(callback)

Example Usage



    controller.getPostLetterHistory(function(error, response, context) {

    
    });

Method: exportPostLetterHistory

export post letter history

function exportPostLetterHistory(filename, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | filename | Required | Filename to export to |

Example Usage


    var filename = 'filename';

    controller.exportPostLetterHistory(filename, function(error, response, context) {

    
    });

Back to List of Controllers

Class: PostReturnAddressController

Get singleton instance

The singleton instance of the PostReturnAddressController class can be accessed from the API Client.

var controller = lib.PostReturnAddressController;

Method: createPostReturnAddress

Create post return address

function createPostReturnAddress(returnAddress, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | returnAddress | Required | Address model |

Example Usage


    var returnAddress = new Address({"key":"value"});

    controller.createPostReturnAddress(returnAddress, function(error, response, context) {

    
    });

Method: getPostReturnAddresses

Get list of post return addresses

function getPostReturnAddresses(callback)

Example Usage



    controller.getPostReturnAddresses(function(error, response, context) {

    
    });

Method: getPostReturnAddress

Get specific post return address

function getPostReturnAddress(returnAddressId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | returnAddressId | Required | Return address ID |

Example Usage


    var returnAddressId = 247;

    controller.getPostReturnAddress(returnAddressId, function(error, response, context) {

    
    });

Method: updatePostReturnAddress

Update post return address

function updatePostReturnAddress(returnAddressId, returnAddress, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | returnAddressId | Required | Return address ID | | returnAddress | Required | Address model |

Example Usage


    var returnAddressId = 247;
    var returnAddress = new Address({"key":"value"});

    controller.updatePostReturnAddress(returnAddressId, returnAddress, function(error, response, context) {

    
    });

Method: deletePostReturnAddress

Delete specific post return address

function deletePostReturnAddress(returnAddressId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | returnAddressId | Required | Return address ID |

Example Usage


    var returnAddressId = 247;

    controller.deletePostReturnAddress(returnAddressId, function(error, response, context) {

    
    });

Back to List of Controllers

Class: FaxController

Get singleton instance

The singleton instance of the FaxController class can be accessed from the API Client.

var controller = lib.FaxController;

Method: faxReceiptList

Get List of Fax Receipts

function faxReceiptList(callback)

Example Usage



    controller.faxReceiptList(function(error, response, context) {

    
    });

Method: getFaxReceipt

Get a single fax receipt based on message id.

function getFaxReceipt(messageId, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | messageId | Required | ID of the message receipt to retrieve |

Example Usage


    var messageId = message_id;

    controller.getFaxReceipt(messageId, function(error, response, context) {

    
    });

Method: getFaxHistory

Get a list of Fax History.

function getFaxHistory(dateFrom, dateTo, q, order, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | dateFrom | Optional | Customize result by setting from date (timestsamp) Example: 1457572619. | | dateTo | Optional | Customize result by setting to date (timestamp) Example: 1457573000. | | q | Optional | Custom query Example: status:Sent,status_code:201. | | order | Optional | Order result by Example: date_added:desc,list_id:desc. |

Example Usage


    var dateFrom = 247;
    var dateTo = 247;
    var q = 'q';
    var order = 'order';

    controller.getFaxHistory(dateFrom, dateTo, q, order, function(error, response, context) {

    
    });

Method: calculatePrice

Calculate Total Price for Fax Messages sent

function calculatePrice(faxMessage, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | faxMessage | Required | FaxMessageCollection model |

Example Usage


    var faxMessage = new FaxMessageCollection({"key":"value"});

    controller.calculatePrice(faxMessage, function(error, response, context) {

    
    });

Method: sendFax

Send a fax using supplied supported file-types.

function sendFax(faxMessage, callback)

Parameters

| Parameter | Tags | Description | |-----------|------|-------------| | faxMessage | Required | FaxMessageCollection model |

Example Usage


    var faxMessage = new FaxMessageCollection({"key":"value"});

    controller.sendFax(faxMessage, function(error, response, context) {

    
    });

Back to List of Controllers

Class: MMSController

Get singleton instance

The singleton instance of the MMSController class can be accessed from the API Client.

var controller = lib.MMSController;

<a na