sdsdsdsadsadsa v1.22.333
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 --versionnpm -version
Now use npm to resolve all dependencies by running the following command in the root directory (of the SDK folder):
npm installThis 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.
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.
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.
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.jsHow 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)
- Navigate to the root directory of the SDK folder from command prompt.
- Type
mocha --recursiveto run all the tests.
Method 2 (Run all tests)
- Navigate to the
../test/Controllers/directory from command prompt. - Type
mocha *to run all the tests.
Method 3 (Run specific controller's tests)
- Navigate to the
../test/Controllers/directory from command prompt. - Type
mocha ClickSend v3 APIControllerto run all the tests in that controller file.
To increase mocha's default timeout, you can change the
TEST_TIMEOUTparameter's value inTestBootstrap.js.
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 keyClass Reference
List of Controllers
- CountriesController
- SMSController
- VoiceController
- AccountController
- SubaccountController
- ContactListController
- ContactController
- NumberController
- StatisticsController
- EmailToSmsController
- SearchController
- ReferralAccountController
- ResellerAccountController
- TransferCreditController
- AccountRechargeController
- SmsCampaignController
- PostLetterController
- PostReturnAddressController
- FaxController
- MMSController
- PostPostcardController
- UploadController
- PostDirectMailController
CountriesController
Get singleton instance
The singleton instance of the CountriesController class can be accessed from the API Client.
var controller = lib.CountriesController;
getCountries
Tags:
Skips AuthenticationGet all countries
function getCountries(callback)Example Usage
controller.getCountries(function(error, response, context) {
});
SMSController
Get singleton instance
The singleton instance of the SMSController class can be accessed from the API Client.
var controller = lib.SMSController;
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) {
});
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) {
});
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) {
});
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) {
});
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) {
});
getInboundSms
Get all inbound sms
function getInboundSms(callback)Example Usage
controller.getInboundSms(function(error, response, context) {
});
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) {
});
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) {
});
cancelAllScheduledSms
Update all scheduled message as cancelled
function cancelAllScheduledSms(callback)Example Usage
controller.cancelAllScheduledSms(function(error, response, context) {
});
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) {
});
deleteSmsTemplate
Delete sms template
function deleteSmsTemplate(templateId, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| templateId | Required | Template id |
Example Usage
var templateId = 62;
controller.deleteSmsTemplate(templateId, function(error, response, context) {
});
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 = 62;
var smsTemplate = new SmsTemplate({"key":"value"});
controller.updateSmsTemplate(templateId, smsTemplate, function(error, response, context) {
});
getDeliveryReceipts
Get all delivery receipts
function getDeliveryReceipts(callback)Example Usage
controller.getDeliveryReceipts(function(error, response, context) {
});
getSmsTemplates
Get lists of all sms templates
function getSmsTemplates(callback)Example Usage
controller.getSmsTemplates(function(error, response, context) {
});
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) {
});
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) {
});
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 = 62;
var dateTo = 62;
controller.getSmsHistory(dateFrom, dateTo, function(error, response, context) {
});
VoiceController
Get singleton instance
The singleton instance of the VoiceController class can be accessed from the API Client.
var controller = lib.VoiceController;
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) {
});
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) {
});
getVoiceLanguages
Get all voice languages
function getVoiceLanguages(callback)Example Usage
controller.getVoiceLanguages(function(error, response, context) {
});
getVoiceReceipts
Get all voice receipts
function getVoiceReceipts(callback)Example Usage
controller.getVoiceReceipts(function(error, response, context) {
});
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) {
});
cancelVoiceMessages
Update all voice messages as cancelled
function cancelVoiceMessages(callback)Example Usage
controller.cancelVoiceMessages(function(error, response, context) {
});
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) {
});
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 = 62;
var dateTo = 62;
controller.getVoiceHistory(dateFrom, dateTo, function(error, response, context) {
});
AccountController
Get singleton instance
The singleton instance of the AccountController class can be accessed from the API Client.
var controller = lib.AccountController;
getAccount
Get account details
function getAccount(callback)Example Usage
controller.getAccount(function(error, response, context) {
});
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) {
});
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) {
});
accountVerify
Verify new account
function accountVerify(activationToken, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| activationToken | Required | TODO: Add a parameter description |
Example Usage
var activationToken = 62;
controller.accountVerify(activationToken, function(error, response, context) {
});
forgotUsername
Tags:
Skips AuthenticationForgot username
function forgotUsername(email, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
Required | Email belonging to account |
Example Usage
var email = 'email';
controller.forgotUsername(email, function(error, response, context) {
});
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) {
});
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) {
});
SubaccountController
Get singleton instance
The singleton instance of the SubaccountController class can be accessed from the API Client.
var controller = lib.SubaccountController;
getSubaccounts
Get all subaccounts
function getSubaccounts(callback)Example Usage
controller.getSubaccounts(function(error, response, context) {
});
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) {
});
getSubaccount
Get specific subaccount
function getSubaccount(subaccountId, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| subaccountId | Required | ID of subaccount to get |
Example Usage
var subaccountId = 62;
controller.getSubaccount(subaccountId, function(error, response, context) {
});
deleteSubaccount
Delete a subaccount
function deleteSubaccount(subaccountId, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| subaccountId | Required | ID of subaccount to delete |
Example Usage
var subaccountId = 62;
controller.deleteSubaccount(subaccountId, function(error, response, context) {
});
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 = 62;
controller.regenerateApiKey(subaccountId, function(error, response, context) {
});
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 = 62;
var subaccount = new Subaccount({"key":"value"});
controller.updateSubaccount(subaccountId, subaccount, function(error, response, context) {
});
ContactListController
Get singleton instance
The singleton instance of the ContactListController class can be accessed from the API Client.
var controller = lib.ContactListController;
getContactLists
Get all contact lists
function getContactLists(callback)Example Usage
controller.getContactLists(function(error, response, context) {
});
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) {
});
getContactList
Get specific contact list
function getContactList(listId, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| listId | Required | List ID |
Example Usage
var listId = 62;
controller.getContactList(listId, function(error, response, context) {
});
deleteContactList
Delete a specific contact list
function deleteContactList(listId, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| listId | Required | List ID |
Example Usage
var listId = 62;
controller.deleteContactList(listId, function(error, response, context) {
});
removeDuplicateContacts
Remove duplicate contacts
function removeDuplicateContacts(listId, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| listId | Required | Your list id |
Example Usage
var listId = 62;
controller.removeDuplicateContacts(listId, function(error, response, context) {
});
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 = 62;
var listName = list_name;
controller.updateContactList(listId, listName, function(error, response, context) {
});
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 = 62;
var file = new ContactListImport({"key":"value"});
controller.importContactsToList(listId, file, function(error, response, context) {
});
ContactController
Get singleton instance
The singleton instance of the ContactController class can be accessed from the API Client.
var controller = lib.ContactController;
getContacts
Get all contacts in a list
function getContacts(listId, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| listId | Required | Contact list ID |
Example Usage
var listId = 62;
controller.getContacts(listId, function(error, response, context) {
});
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 = 62;
controller.createContact(contact, listId, function(error, response, context) {
});
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 = 62;
var contactId = 62;
controller.getContact(listId, contactId, function(error, response, context) {
});
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 = 62;
var contactId = 62;
var contact = new Contact({"key":"value"});
controller.updateContact(listId, contactId, contact, function(error, response, context) {
});
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 = 62;
var optOutListId = 62;
controller.removeOptedOutContacts(listId, optOutListId, function(error, response, context) {
});
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 = 62;
var contactId = 62;
controller.deleteContact(listId, contactId, function(error, response, context) {
});
NumberController
Get singleton instance
The singleton instance of the NumberController class can be accessed from the API Client.
var controller = lib.NumberController;
getDedicatedNumbers
Get all dedicated numbers
function getDedicatedNumbers(callback)Example Usage
controller.getDedicatedNumbers(function(error, response, context) {
});
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) {
});
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 = 62;
controller.getDedicatedNumbersByCountry(country, search, searchType, function(error, response, context) {
});
StatisticsController
Get singleton instance
The singleton instance of the StatisticsController class can be accessed from the API Client.
var controller = lib.StatisticsController;
getVoiceStatistics
Get voice statistics
function getVoiceStatistics(callback)Example Usage
controller.getVoiceStatistics(function(error, response, context) {
});
getSmsStatistics
Get sms statistics
function getSmsStatistics(callback)Example Usage
controller.getSmsStatistics(function(error, response, context) {
});
EmailToSmsController
Get singleton instance
The singleton instance of the EmailToSmsController class can be accessed from the API Client.
var controller = lib.EmailToSmsController;
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) {
});
getAllowedAddress
Get list of email to sms allowed addresses
function getAllowedAddress(callback)Example Usage
controller.getAllowedAddress(function(error, response, context) {
});
SearchController
Get singleton instance
The singleton instance of the SearchController class can be accessed from the API Client.
var controller = lib.SearchController;
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) {
});
ReferralAccountController
Get singleton instance
The singleton instance of the ReferralAccountController class can be accessed from the API Client.
var controller = lib.ReferralAccountController;
getReferralAccounts
Get all referral accounts
function getReferralAccounts(callback)Example Usage
controller.getReferralAccounts(function(error, response, context) {
});
ResellerAccountController
Get singleton instance
The singleton instance of the ResellerAccountController class can be accessed from the API Client.
var controller = lib.ResellerAccountController;
getResellerAccounts
Get list of reseller accounts
function getResellerAccounts(callback)Example Usage
controller.getResellerAccounts(function(error, response, context) {
});
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) {
});
getResellerAccount
Get Reseller Account
function getResellerAccount(clientUserId, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| clientUserId | Required | User ID of client |
Example Usage
var clientUserId = 62;
controller.getResellerAccount(clientUserId, function(error, response, context) {
});
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 = 62;
var resellerAccount = new ResellerAccount({"key":"value"});
controller.updateResellerAccount(clientUserId, resellerAccount, function(error, response, context) {
});
TransferCreditController
Get singleton instance
The singleton instance of the TransferCreditController class can be accessed from the API Client.
var controller = lib.TransferCreditController;
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) {
});
AccountRechargeController
Get singleton instance
The singleton instance of the AccountRechargeController class can be accessed from the API Client.
var controller = lib.AccountRechargeController;
getCreditCardInfo
Get Credit Card info
function getCreditCardInfo(callback)Example Usage
controller.getCreditCardInfo(function(error, response, context) {
});
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) {
});
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) {
});
purchasePackage
Purchase a package
function purchasePackage(packageId, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| packageId | Required | ID of package to purchase |
Example Usage
var packageId = 62;
controller.purchasePackage(packageId, function(error, response, context) {
});
getTransactions
Get all transactions
function getTransactions(callback)Example Usage
controller.getTransactions(function(error, response, context) {
});
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) {
});
SmsCampaignController
Get singleton instance
The singleton instance of the SmsCampaignController class can be accessed from the API Client.
var controller = lib.SmsCampaignController;
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) {
});
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) {
});
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 = 62;
var campaign = new SmsCampaign({"key":"value"});
controller.updateSmsCampaign(smsCampaignId, campaign, function(error, response, context) {
});
cancelSmsCampaign
Cancel sms campaign
function cancelSmsCampaign(smsCampaignId, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| smsCampaignId | Required | ID of SMS Campaign to cancel |
Example Usage
var smsCampaignId = 62;
controller.cancelSmsCampaign(smsCampaignId, function(error, response, context) {
});
getSmsCampaigns
Get list of sms campaigns
function getSmsCampaigns(callback)Example Usage
controller.getSmsCampaigns(function(error, response, context) {
});
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 = 62;
controller.getSmsCampaign(smsCampaignId, function(error, response, context) {
});
PostLetterController
Get singleton instance
The singleton instance of the PostLetterController class can be accessed from the API Client.
var controller = lib.PostLetterController;
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) {
});
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) {
});
getPostLetterHistory
Get all post letter history
function getPostLetterHistory(callback)Example Usage
controller.getPostLetterHistory(function(error, response, context) {
});
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) {
});
PostReturnAddressController
Get singleton instance
The singleton instance of the PostReturnAddressController class can be accessed from the API Client.
var controller = lib.PostReturnAddressController;
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) {
});
getPostReturnAddresses
Get list of post return addresses
function getPostReturnAddresses(callback)Example Usage
controller.getPostReturnAddresses(function(error, response, context) {
});
getPostReturnAddress
Get specific post return address
function getPostReturnAddress(returnAddressId, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| returnAddressId | Required | Return address ID |
Example Usage
var returnAddressId = 62;
controller.getPostReturnAddress(returnAddressId, function(error, response, context) {
});
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 = 62;
var returnAddress = new Address({"key":"value"});
controller.updatePostReturnAddress(returnAddressId, returnAddress, function(error, response, context) {
});
deletePostReturnAddress
Delete specific post return address
function deletePostReturnAddress(returnAddressId, callback)Parameters
| Parameter | Tags | Description |
|---|---|---|
| returnAddressId | Required | Return address ID |
Example Usage
var returnAddressId = 62;
controller.deletePostReturnAddress(returnAddressId, function(error, response, context) {
});
FaxController
Get singleton instance
The singleton instance of the FaxController class can be accessed from the API Client.
var controller = lib.FaxController;
faxReceiptList
Get List of Fax Receipts
function faxReceiptList(callback)Example Usage
controller.faxReceiptList(function(error, response, context) {
});
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) {
});
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 = 62;
var dateTo = 62;
var q = 'q';
var order = 'order';
controller.getFaxHistory(dateFrom, dateTo, q, order, function(error, response, context) {
});
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) {
});
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) {
});
MMSController
Get singleton instance
The singleton instance of the MMSController class can be accessed from the API Client.
var controller = lib.MMSController;
(https://
8 years ago