Skip to content

GeorgeCraggs/clicksend-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting started

Clicksend v3 API

How to Build

This client library is a Ruby gem which can be compiled and used in your Ruby and Ruby on Rails project. This library requires a few gems from the RubyGems repository.

  1. Open the command line interface or the terminal and navigate to the folder containing the source code.
  2. Run gem build click_send.gemspec to build the gem.
  3. Once built, the gem can be installed on the current work environment using gem install click_send-3.1.0.gem

Building Gem

How to Use

The following section explains how to use the ClickSend Ruby Gem in a new Rails project using RubyMine™. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.

1. Starting a new project

Close any existing projects in RubyMine™ by selecting File -> Close Project. Next, click on Create New Project to create a new project from scratch.

Create a new project in RubyMine

Next, provide TestApp as the project name, choose Rails Application as the project type, and click OK.

Create a new Rails Application in RubyMine - step 1

In the next dialog make sure that correct Ruby SDK is being used (minimum 2.0.0) and click OK.

Create a new Rails Application in RubyMine - step 2

This will create a new Rails Application project with an existing set of files and folder.

2. Add reference of the gem

In order to use the ClickSend gem in the new project we must add a gem reference. Locate the Gemfile in the Project Explorer window under the TestApp project node. The file contains references to all gems being used in the project. Here, add the reference to the library gem by adding the following line: gem 'click_send', '~> 3.1.0'

Add references of the Gemfile

3. Adding a new Rails Controller

Once the TestApp project is created, a folder named controllers will be visible in the Project Explorer under the following path: TestApp > app > controllers. Right click on this folder and select New -> Run Rails Generator....

Run Rails Generator on Controllers Folder

Selecting the said option will popup a small window where the generator names are displayed. Here, select the controller template.

Create a new Controller

Next, a popup window will ask you for a Controller name and included Actions. For controller name provide Hello and include an action named Index and click OK.

Add a new Controller

A new controller class anmed HelloController will be created in a file named hello_controller.rb containing a method named Index. In this method, add code for initialization and a sample for its usage.

Initialize the library

How to Test

You can test the generated SDK and the server with automatically generated test cases as follows:

  1. From terminal/cmd navigate to the root directory of the SDK.
  2. Invoke: bundle exec rake

Initialization

Authentication

In order to setup authentication and initialization of the API client, you need the following information.

Parameter Description
username your username
key your api key

API client can be initialized as following.

# Configuration parameters and credentials
username = 'username' # your username
key = 'key' # your api key

client = ClickSend::ClickSend.new(
  username: username,
  key: key
)

The added initlization code can be debugged by putting a breakpoint in the Index method and running the project in debug mode by selecting Run -> Debug 'Development: TestApp'.

Debug the TestApp

Class Reference

List of Controllers

Class: CountriesController

Get singleton instance

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

countries_controller = client.countries

Method: get_countries

Tags: Skips Authentication

Get all countries

def get_countries; end

Example Usage

result = countries_controller.get_countries()

Back to List of Controllers

Class: SMSController

Get singleton instance

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

sMS_controller = client.sms

Method: send_sms

Send one or more SMS messages

def send_sms(sms_messages); end

Parameters

Parameter Tags Description
sms_messages Required SmsMessageCollection model

Example Usage

sms_messages = SmsMessageCollection.new

result = sMS_controller.send_sms(sms_messages)

Method: calculate_price

Calculate sms price

def calculate_price(sms_messages); end

Parameters

Parameter Tags Description
sms_messages Required SmsMessageCollection model

Example Usage

sms_messages = SmsMessageCollection.new

result = sMS_controller.calculate_price(sms_messages)

Method: export_history

Export all sms history

def export_history(filename); end

Parameters

Parameter Tags Description
filename Required Filename to download history as

Example Usage

filename = 'filename'

result = sMS_controller.export_history(filename)

Method: create_receipt

Add a delivery receipt

def create_receipt(url); end

Parameters

Parameter Tags Description
url Required Your url

Example Usage

url = 'url'

result = sMS_controller.create_receipt(url)

Method: mark_receipts_as_read

Marked delivery receipts as read

def mark_receipts_as_read(date_before = nil); end

Parameters

Parameter Tags Description
date_before Optional Mark all as read before this timestamp

Example Usage

date_before = 'date_before'

result = sMS_controller.mark_receipts_as_read(date_before)

Method: get_inbound_sms

Get all inbound sms

def get_inbound_sms; end

Example Usage

result = sMS_controller.get_inbound_sms()

Method: create_inbound_sms

Create inbound sms

def create_inbound_sms(url); end

Parameters

Parameter Tags Description
url Required Your url

Example Usage

url = 'url'

result = sMS_controller.create_inbound_sms(url)

Method: cancel_scheduled_sms

Update scheduled message as cancel

def cancel_scheduled_sms(message_id); end

Parameters

Parameter Tags Description
message_id Required The message ID you want to cancel

Example Usage

message_id = 'message_id'

result = sMS_controller.cancel_scheduled_sms(message_id)

Method: cancel_all_scheduled_sms

Update all scheduled message as cancelled

def cancel_all_scheduled_sms; end

Example Usage

result = sMS_controller.cancel_all_scheduled_sms()

Method: create_sms_template

Create sms template

def create_sms_template(sms_template); end

Parameters

Parameter Tags Description
sms_template Required SmsTemplate model

Example Usage

sms_template = SmsTemplate.new

result = sMS_controller.create_sms_template(sms_template)

Method: delete_sms_template

Delete sms template

def delete_sms_template(template_id); end

Parameters

Parameter Tags Description
template_id Required Template id

Example Usage

template_id = 218

result = sMS_controller.delete_sms_template(template_id)

Method: update_sms_template

Update sms template

def update_sms_template(template_id,
                            sms_template); end

Parameters

Parameter Tags Description
template_id Required Template id
sms_template Required Template item

Example Usage

template_id = 218
sms_template = SmsTemplate.new

result = sMS_controller.update_sms_template(template_id, sms_template)

Method: get_delivery_receipts

Get all delivery receipts

def get_delivery_receipts; end

Example Usage

result = sMS_controller.get_delivery_receipts()

Method: get_sms_templates

Get lists of all sms templates

def get_sms_templates; end

Example Usage

result = sMS_controller.get_sms_templates()

Method: mark_all_inbound_sms_as_read

Mark all inbound SMS as read optionally before a certain date

def mark_all_inbound_sms_as_read(date_before = nil); end

Parameters

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

Example Usage

date_before = 'date_before'

result = sMS_controller.mark_all_inbound_sms_as_read(date_before)

Method: get_specific_delivery_receipt

Get a Specific Delivery Receipt

def get_specific_delivery_receipt(message_id); end

Parameters

Parameter Tags Description
message_id Required Message ID

Example Usage

message_id = 'message_id'

result = sMS_controller.get_specific_delivery_receipt(message_id)

Method: get_sms_history

Get all sms history

def get_sms_history(date_from = nil,
                        date_to = nil); end

Parameters

Parameter Tags Description
date_from Optional Start date
date_to Optional End date

Example Usage

date_from = 218
date_to = 218

result = sMS_controller.get_sms_history(date_from, date_to)

Back to List of Controllers

Class: VoiceController

Get singleton instance

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

voice_controller = client.voice

Method: send_voice

Send a voice call

def send_voice(voice_messages); end

Parameters

Parameter Tags Description
voice_messages Required VoiceMessageCollection model

Example Usage

voice_messages = VoiceMessageCollection.new

result = voice_controller.send_voice(voice_messages)

Method: calculate_price

Calculate voice price

def calculate_price(voice_messages); end

Parameters

Parameter Tags Description
voice_messages Required VoiceMessageCollection model

Example Usage

voice_messages = VoiceMessageCollection.new

result = voice_controller.calculate_price(voice_messages)

Method: get_voice_languages

Get all voice languages

def get_voice_languages; end

Example Usage

result = voice_controller.get_voice_languages()

Method: get_voice_receipts

Get all voice receipts

def get_voice_receipts; end

Example Usage

result = voice_controller.get_voice_receipts()

Method: cancel_voice_message

Update voice message status as cancelled

def cancel_voice_message(message_id); end

Parameters

Parameter Tags Description
message_id Required Your voice message id

Example Usage

message_id = 'message_id'

result = voice_controller.cancel_voice_message(message_id)

Method: cancel_voice_messages

Update all voice messages as cancelled

def cancel_voice_messages; end

Example Usage

result = voice_controller.cancel_voice_messages()

Method: export_voice_history

Export voice history

def export_voice_history(filename); end

Parameters

Parameter Tags Description
filename Required Filename to export to

Example Usage

filename = 'filename'

result = voice_controller.export_voice_history(filename)

Method: get_voice_history

Get all voice history

def get_voice_history(date_from = nil,
                          date_to = nil); end

Parameters

Parameter Tags Description
date_from Optional Timestamp (from) used to show records by date.
date_to Optional Timestamp (to) used to show records by date

Example Usage

date_from = 218
date_to = 218

result = voice_controller.get_voice_history(date_from, date_to)

Back to List of Controllers

Class: AccountController

Get singleton instance

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

account_controller = client.account

Method: get_account

Get account details

def get_account; end

Example Usage

result = account_controller.get_account()

Method: create_account

Create An Account

def create_account(account); end

Parameters

Parameter Tags Description
account Required Account model

Example Usage

account = Account.new

result = account_controller.create_account(account)

Method: account_verify_send

Send account activation token

def account_verify_send(account_verify); end

Parameters

Parameter Tags Description
account_verify Required Account details

Example Usage

account_verify = AccountVerify.new

result = account_controller.account_verify_send(account_verify)

Method: account_verify

Verify new account

def account_verify(activation_token); end

Parameters

Parameter Tags Description
activation_token Required TODO: Add a parameter description

Example Usage

activation_token = 218

result = account_controller.account_verify(activation_token)

Method: forgot_username

Tags: Skips Authentication

Forgot username

def forgot_username(email); end

Parameters

Parameter Tags Description
email Required Email belonging to account

Example Usage

email = 'email'

result = account_controller.forgot_username(email)

Method: forgot_password

Forgot password

def forgot_password(username); end

Parameters

Parameter Tags Description
username Required Username belonging to account

Example Usage

username = 'username'

result = account_controller.forgot_password(username)

Method: verify_forgot_password

Verify forgot password

def verify_forgot_password(verify_password); end

Parameters

Parameter Tags Description
verify_password Required verifyPassword data

Example Usage

verify_password = AccountForgotPasswordVerify.new

result = account_controller.verify_forgot_password(verify_password)

Back to List of Controllers

Class: SubaccountController

Get singleton instance

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

subaccount_controller = client.subaccount

Method: get_subaccounts

Get all subaccounts

def get_subaccounts; end

Example Usage

result = subaccount_controller.get_subaccounts()

Method: create_subaccount

Create new subaccount

def create_subaccount(subaccount); end

Parameters

Parameter Tags Description
subaccount Required Subaccount model

Example Usage

subaccount = Subaccount.new

result = subaccount_controller.create_subaccount(subaccount)

Method: get_subaccount

Get specific subaccount

def get_subaccount(subaccount_id); end

Parameters

Parameter Tags Description
subaccount_id Required ID of subaccount to get

Example Usage

subaccount_id = 218

result = subaccount_controller.get_subaccount(subaccount_id)

Method: delete_subaccount

Delete a subaccount

def delete_subaccount(subaccount_id); end

Parameters

Parameter Tags Description
subaccount_id Required ID of subaccount to delete

Example Usage

subaccount_id = 218

result = subaccount_controller.delete_subaccount(subaccount_id)

Method: regenerate_api_key

Regenerate an API Key

def regenerate_api_key(subaccount_id); end

Parameters

Parameter Tags Description
subaccount_id Required ID of subaccount to regenerate API key for

Example Usage

subaccount_id = 218

result = subaccount_controller.regenerate_api_key(subaccount_id)

Method: update_subaccount

Update subaccount

def update_subaccount(subaccount_id,
                          subaccount); end

Parameters

Parameter Tags Description
subaccount_id Required ID of subaccount to update
subaccount Required Subaccount model

Example Usage

subaccount_id = 218
subaccount = Subaccount.new

result = subaccount_controller.update_subaccount(subaccount_id, subaccount)

Back to List of Controllers

Class: ContactListController

Get singleton instance

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

contactList_controller = client.contact_list

Method: get_contact_lists

Get all contact lists

def get_contact_lists; end

Example Usage

result = contactList_controller.get_contact_lists()

Method: create_contact_list

Create new contact list

def create_contact_list(list_name); end

Parameters

Parameter Tags Description
list_name Required Your contact list name

Example Usage

list_name = 'list_name'

result = contactList_controller.create_contact_list(list_name)

Method: get_contact_list

Get specific contact list

def get_contact_list(list_id); end

Parameters

Parameter Tags Description
list_id Required List ID

Example Usage

list_id = 218

result = contactList_controller.get_contact_list(list_id)

Method: delete_contact_list

Delete a specific contact list

def delete_contact_list(list_id); end

Parameters

Parameter Tags Description
list_id Required List ID

Example Usage

list_id = 218

result = contactList_controller.delete_contact_list(list_id)

Method: remove_duplicate_contacts

Remove duplicate contacts

def remove_duplicate_contacts(list_id); end

Parameters

Parameter Tags Description
list_id Required Your list id

Example Usage

list_id = 218

result = contactList_controller.remove_duplicate_contacts(list_id)

Method: update_contact_list

Update specific contact list

def update_contact_list(list_id,
                            list_name); end

Parameters

Parameter Tags Description
list_id Required Your list id
list_name Required Your new list name

Example Usage

list_id = 218
list_name = 'list_name'

result = contactList_controller.update_contact_list(list_id, list_name)

Method: import_contacts_to_list

Import contacts to list

def import_contacts_to_list(list_id,
                                file); end

Parameters

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

Example Usage

list_id = 218
file = ContactListImport.new

result = contactList_controller.import_contacts_to_list(list_id, file)

Back to List of Controllers

Class: ContactController

Get singleton instance

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

contact_controller = client.contact

Method: create_contact

Create new contact

def create_contact(contact,
                       list_id); end

Parameters

Parameter Tags Description
contact Required Contact model
list_id Required List id

Example Usage

contact = Contact.new
list_id = 218

result = contact_controller.create_contact(contact, list_id)

Method: get_contact

Get a specific contact

def get_contact(list_id,
                    contact_id); end

Parameters

Parameter Tags Description
list_id Required Your contact list id you want to access.
contact_id Required Your contact id you want to access.

Example Usage

list_id = 218
contact_id = 218

result = contact_controller.get_contact(list_id, contact_id)

Method: update_contact

Update contact

def update_contact(list_id,
                       contact_id,
                       contact); end

Parameters

Parameter Tags Description
list_id Required Contact list id
contact_id Required Contact ID
contact Required Contact model

Example Usage

list_id = 218
contact_id = 218
contact = Contact.new

result = contact_controller.update_contact(list_id, contact_id, contact)

Method: remove_opted_out_contacts

Remove all opted out contacts

def remove_opted_out_contacts(list_id,
                                  opt_out_list_id); end

Parameters

Parameter Tags Description
list_id Required Your list id
opt_out_list_id Required Your opt out list id

Example Usage

list_id = 218
opt_out_list_id = 218

result = contact_controller.remove_opted_out_contacts(list_id, opt_out_list_id)

Method: delete_contact

Delete a contact

def delete_contact(list_id,
                       contact_id); end

Parameters

Parameter Tags Description
list_id Required List ID
contact_id Required Contact ID

Example Usage

list_id = 218
contact_id = 218

result = contact_controller.delete_contact(list_id, contact_id)

Method: get_contacts

Get all contacts in a list

def get_contacts(list_id,
                     page_num = 1); end

Parameters

Parameter Tags Description
list_id Required Contact list ID
page_num Optional DefaultValue Page number

Example Usage

list_id = 218
page_num = 1

result = contact_controller.get_contacts(list_id, page_num)

Back to List of Controllers

Class: NumberController

Get singleton instance

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

number_controller = client.number

Method: get_dedicated_numbers

Get all dedicated numbers

def get_dedicated_numbers; end

Example Usage

result = number_controller.get_dedicated_numbers()

Method: purchase_dedicated_number

Buy dedicated number

def purchase_dedicated_number(dedicated_number); end

Parameters

Parameter Tags Description
dedicated_number Required Phone number to purchase

Example Usage

dedicated_number = 'dedicated_number'

result = number_controller.purchase_dedicated_number(dedicated_number)

Method: get_dedicated_numbers_by_country

Get all dedicated numbers by country

def get_dedicated_numbers_by_country(country,
                                         search = nil,
                                         search_type = nil); end

Parameters

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

Example Usage

country = 'country'
search = 'search'
search_type = 218

result = number_controller.get_dedicated_numbers_by_country(country, search, search_type)

Back to List of Controllers

Class: StatisticsController

Get singleton instance

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

statistics_controller = client.statistics

Method: get_voice_statistics

Get voice statistics

def get_voice_statistics; end

Example Usage

result = statistics_controller.get_voice_statistics()

Method: get_sms_statistics

Get sms statistics

def get_sms_statistics; end

Example Usage

result = statistics_controller.get_sms_statistics()

Back to List of Controllers

Class: EmailToSmsController

Get singleton instance

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

emailToSms_controller = client.email_to_sms

Method: create_allowed_address

Create email to sms allowed address

def create_allowed_address(email_sms_address); end

Parameters

Parameter Tags Description
email_sms_address Required EmailSMSAddress model

Example Usage

email_sms_address = EmailSMSAddress.new

result = emailToSms_controller.create_allowed_address(email_sms_address)

Method: get_allowed_address

Get list of email to sms allowed addresses

def get_allowed_address; end

Example Usage

result = emailToSms_controller.get_allowed_address()

Back to List of Controllers

Class: SearchController

Get singleton instance

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

search_controller = client.search

Method: search_contact_list

Get list of searched contact list

def search_contact_list(q); end

Parameters

Parameter Tags Description
q Required Your keyword or query.

Example Usage

q = 'q'

result = search_controller.search_contact_list(q)

Back to List of Controllers

Class: ReferralAccountController

Get singleton instance

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

referralAccount_controller = client.referral_account

Method: get_referral_accounts

Get all referral accounts

def get_referral_accounts; end

Example Usage

result = referralAccount_controller.get_referral_accounts()

Back to List of Controllers

Class: ResellerAccountController

Get singleton instance

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

resellerAccount_controller = client.reseller_account

Method: get_reseller_accounts

Get list of reseller accounts

def get_reseller_accounts; end

Example Usage

result = resellerAccount_controller.get_reseller_accounts()

Method: create_reseller_account

Create reseller account

def create_reseller_account(reseller_account); end

Parameters

Parameter Tags Description
reseller_account Required ResellerAccount model

Example Usage

reseller_account = ResellerAccount.new

result = resellerAccount_controller.create_reseller_account(reseller_account)

Method: get_reseller_account

Get Reseller Account

def get_reseller_account(client_user_id); end

Parameters

Parameter Tags Description
client_user_id Required User ID of client

Example Usage

client_user_id = 218

result = resellerAccount_controller.get_reseller_account(client_user_id)

Method: update_reseller_account

Reseller Account

def update_reseller_account(client_user_id,
                                reseller_account); end

Parameters

Parameter Tags Description
client_user_id Required User ID of client
reseller_account Required ResellerAccount model

Example Usage

client_user_id = 218
reseller_account = ResellerAccount.new

result = resellerAccount_controller.update_reseller_account(client_user_id, reseller_account)

Back to List of Controllers

Class: TransferCreditController

Get singleton instance

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

transferCredit_controller = client.transfer_credit

Method: transfer_credit

Transfer Credit

def transfer_credit(reseller_account_transfer_credit); end

Parameters

Parameter Tags Description
reseller_account_transfer_credit Required ResellerAccountTransferCredit model

Example Usage

reseller_account_transfer_credit = ResellerAccountTransferCredit.new

result = transferCredit_controller.transfer_credit(reseller_account_transfer_credit)

Back to List of Controllers

Class: AccountRechargeController

Get singleton instance

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

accountRecharge_controller = client.account_recharge

Method: get_credit_card_info

Get Credit Card info

def get_credit_card_info; end

Example Usage

result = accountRecharge_controller.get_credit_card_info()

Method: update_credit_card_info

Update credit card info

def update_credit_card_info(credit_card); end

Parameters

Parameter Tags Description
credit_card Required CreditCard model

Example Usage

credit_card = CreditCard.new

result = accountRecharge_controller.update_credit_card_info(credit_card)

Method: get_packages_list

Get list of all packages

def get_packages_list(country = nil); end

Parameters

Parameter Tags Description
country Optional Country code

Example Usage

country = 'country'

result = accountRecharge_controller.get_packages_list(country)

Method: purchase_package

Purchase a package

def purchase_package(package_id); end

Parameters

Parameter Tags Description
package_id Required ID of package to purchase

Example Usage

package_id = 218

result = accountRecharge_controller.purchase_package(package_id)

Method: get_transactions

Get all transactions

def get_transactions; end

Example Usage

result = accountRecharge_controller.get_transactions()

Method: get_transaction

Get specific Transaction

def get_transaction(transaction_id); end

Parameters

Parameter Tags Description
transaction_id Required ID of transaction to retrieve

Example Usage

transaction_id = 'transaction_id'

result = accountRecharge_controller.get_transaction(transaction_id)

Back to List of Controllers

Class: SmsCampaignController

Get singleton instance

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

smsCampaign_controller = client.sms_campaign

Method: create_sms_campaign

Create sms campaign

def create_sms_campaign(campaign); end

Parameters

Parameter Tags Description
campaign Required SmsCampaign model

Example Usage

campaign = SmsCampaign.new

result = smsCampaign_controller.create_sms_campaign(campaign)

Method: calculate_price

Calculate price for sms campaign

def calculate_price(campaign); end

Parameters

Parameter Tags Description
campaign Required SmsCampaign model

Example Usage

campaign = SmsCampaign.new

result = smsCampaign_controller.calculate_price(campaign)

Method: update_sms_campaign

Update sms campaign

def update_sms_campaign(sms_campaign_id,
                            campaign); end

Parameters

Parameter Tags Description
sms_campaign_id Required ID of SMS campaign to update
campaign Required SmsCampaign model

Example Usage

sms_campaign_id = 218
campaign = SmsCampaign.new

result = smsCampaign_controller.update_sms_campaign(sms_campaign_id, campaign)

Method: cancel_sms_campaign

Cancel sms campaign

def cancel_sms_campaign(sms_campaign_id); end

Parameters

Parameter Tags Description
sms_campaign_id Required ID of SMS Campaign to cancel

Example Usage

sms_campaign_id = 218

result = smsCampaign_controller.cancel_sms_campaign(sms_campaign_id)

Method: get_sms_campaigns

Get list of sms campaigns

def get_sms_campaigns; end

Example Usage

result = smsCampaign_controller.get_sms_campaigns()

Method: get_sms_campaign

Get specific sms campaign

def get_sms_campaign(sms_campaign_id); end

Parameters

Parameter Tags Description
sms_campaign_id Required ID of SMS campaign to retrieve

Example Usage

sms_campaign_id = 218

result = smsCampaign_controller.get_sms_campaign(sms_campaign_id)

Back to List of Controllers

Class: PostLetterController

Get singleton instance

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

postLetter_controller = client.post_letter

Method: send_post_letter

Send post letter

def send_post_letter(post_letter); end

Parameters

Parameter Tags Description
post_letter Required PostLetter model

Example Usage

post_letter = PostLetter.new

result = postLetter_controller.send_post_letter(post_letter)

Method: calculate_price

Calculate post letter price

def calculate_price(post_letter); end

Parameters

Parameter Tags Description
post_letter Required PostLetter model

Example Usage

post_letter = PostLetter.new

result = postLetter_controller.calculate_price(post_letter)

Method: get_post_letter_history

Get all post letter history

def get_post_letter_history; end

Example Usage

result = postLetter_controller.get_post_letter_history()

Method: export_post_letter_history

export post letter history

def export_post_letter_history(filename); end

Parameters

Parameter Tags Description
filename Required Filename to export to

Example Usage

filename = 'filename'

result = postLetter_controller.export_post_letter_history(filename)

Back to List of Controllers

Class: PostReturnAddressController

Get singleton instance

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

postReturnAddress_controller = client.post_return_address

Method: create_post_return_address

Create post return address

def create_post_return_address(return_address); end

Parameters

Parameter Tags Description
return_address Required Address model

Example Usage

return_address = Address.new

result = postReturnAddress_controller.create_post_return_address(return_address)

Method: get_post_return_addresses

Get list of post return addresses

def get_post_return_addresses; end

Example Usage

result = postReturnAddress_controller.get_post_return_addresses()

Method: get_post_return_address

Get specific post return address

def get_post_return_address(return_address_id); end

Parameters

Parameter Tags Description
return_address_id Required Return address ID

Example Usage

return_address_id = 218

result = postReturnAddress_controller.get_post_return_address(return_address_id)

Method: update_post_return_address

Update post return address

def update_post_return_address(return_address_id,
                                   return_address); end

Parameters

Parameter Tags Description
return_address_id Required Return address ID
return_address Required Address model

Example Usage

return_address_id = 218
return_address = Address.new

result = postReturnAddress_controller.update_post_return_address(return_address_id, return_address)

Method: delete_post_return_address

Delete specific post return address

def delete_post_return_address(return_address_id); end

Parameters

Parameter Tags Description
return_address_id Required Return address ID

Example Usage

return_address_id = 218

result = postReturnAddress_controller.delete_post_return_address(return_address_id)

Back to List of Controllers

Class: FaxController

Get singleton instance

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

fax_controller = client.fax

Method: fax_receipt_list

Get List of Fax Receipts

def fax_receipt_list; end

Example Usage

result = fax_controller.fax_receipt_list()

Method: get_fax_receipt

Get a single fax receipt based on message id.

def get_fax_receipt(message_id); end

Parameters

Parameter Tags Description
message_id Required ID of the message receipt to retrieve

Example Usage

message_id = 'message_id'

result = fax_controller.get_fax_receipt(message_id)

Method: get_fax_history

Get a list of Fax History.

def get_fax_history(date_from = nil,
                        date_to = nil,
                        q = nil,
                        order = nil); end

Parameters

Parameter Tags Description
date_from Optional Customize result by setting from date (timestsamp) Example: 1457572619.
date_to 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

date_from = 55
date_to = 55
q = 'q'
order = 'order'

result = fax_controller.get_fax_history(date_from, date_to, q, order)

Method: calculate_price

Calculate Total Price for Fax Messages sent

def calculate_price(fax_message); end

Parameters

Parameter Tags Description
fax_message Required FaxMessageCollection model

Example Usage

fax_message = FaxMessageCollection.new

result = fax_controller.calculate_price(fax_message)

Method: send_fax

Send a fax using supplied supported file-types.

def send_fax(fax_message); end

Parameters

Parameter Tags Description
fax_message Required FaxMessageCollection model

Example Usage

fax_message = FaxMessageCollection.new

result = fax_controller.send_fax(fax_message)

Back to List of Controllers

Class: MMSController

Get singleton instance

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

mMS_controller = client.mms

Method: send_mms

TODO: Add a method description

def send_mms(mms_messages); end

Parameters

Parameter Tags Description
mms_messages Required MmsMessageCollection model

Example Usage

mms_messages = MmsMessageCollection.new

result = mMS_controller.send_mms(mms_messages)

Method: get_price

Get Price for MMS sent

def get_price(mms_messages); end

Parameters

Parameter Tags Description
mms_messages Required MmsMessageCollection model

Example Usage

mms_messages = MmsMessageCollection.new

result = mMS_controller.get_price(mms_messages)

Back to List of Controllers

Class: PostPostcardController

Get singleton instance

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

postPostcard_controller = client.post_postcard

Method: send_postcard

Send one or more postcards

def send_postcard(post_postcards); end

Parameters

Parameter Tags Description
post_postcards Required PostPostcard model

Example Usage

post_postcards = PostPostcard.new

result = postPostcard_controller.send_postcard(post_postcards)

Method: calculate_price

Calculate price for sending one or more postcards

def calculate_price(post_postcards); end

Parameters

Parameter Tags Description
post_postcards Required PostPostcard model

Example Usage

post_postcards = PostPostcard.new

result = postPostcard_controller.calculate_price(post_postcards)

Method: get_postcard_history

Retrieve the history of postcards sent or scheduled

def get_postcard_history; end

Example Usage

result = postPostcard_controller.get_postcard_history()

Method: export_postcard_history

Export postcard history to a CSV file

def export_postcard_history(filename); end

Parameters

Parameter Tags Description
filename Required Filename to export to

Example Usage

filename = 'filename'

result = postPostcard_controller.export_postcard_history(filename)

Back to List of Controllers

Class: UploadController

Get singleton instance

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

upload_controller = client.upload

Method: upload_file

Upload a file

def upload_file(file,
                    convert); end

Parameters

Parameter Tags Description
file Required The file to be uploaded
convert Required The product that this file will be used with e.g. 'fax', 'mms', 'csv' or 'post'

Example Usage

file = Faraday::UploadIO.new('PathToFile', 'application/octet-stream')
convert = 'convert'

result = upload_controller.upload_file(file, convert)

Method: upload_file1

TODO: Add a method description

def upload_file1(content,
                     convert); end

Parameters

Parameter Tags Description
content Required Base64-encoded file contents
convert Required The product that this file will be used with e.g. 'fax', 'mms', 'csv' or 'post'

Example Usage

content = FileContent.new
convert = 'convert'

result = upload_controller.upload_file1(content, convert)

Back to List of Controllers

Class: PostDirectMailController

Get singleton instance

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

postDirectMail_controller = client.post_direct_mail

Method: location_search

Search for a location

def location_search(country,
                        q); end

Parameters

Parameter Tags Description
country Required Country Code to search
q Required Search term (e.g. post code, city name)

Example Usage

country = 'country'
q = 'q'

result = postDirectMail_controller.location_search(country, q)

Method: send_campaign

TODO: Add a method description

def send_campaign(post_direct_mail); end

Parameters

Parameter Tags Description
post_direct_mail Required PostDirectMail model

Example Usage

post_direct_mail = PostDirectMail.new

result = postDirectMail_controller.send_campaign(post_direct_mail)

Method: calculate_price

Calculate direct mail campaign price

def calculate_price(post_direct_mail); end

Parameters

Parameter Tags Description
post_direct_mail Required PostDirectMail model

Example Usage

post_direct_mail = PostDirectMail.new

result = postDirectMail_controller.calculate_price(post_direct_mail)

Method: campaigns

Get direct mail campaigns

def campaigns; end

Example Usage

result = postDirectMail_controller.campaigns()

Back to List of Controllers

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages