Clicksend v3 API
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.
- Open the command line interface or the terminal and navigate to the folder containing the source code.
- Run
gem build click_send.gemspec
to build the gem. - Once built, the gem can be installed on the current work environment using
gem install click_send-3.1.0.gem
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.
Close any existing projects in RubyMine™ by selecting File -> Close Project
. Next, click on Create New Project
to create a new project from scratch.
Next, provide TestApp
as the project name, choose Rails Application
as the project type, and click OK
.
In the next dialog make sure that correct Ruby SDK is being used (minimum 2.0.0) and click OK
.
This will create a new Rails Application project with an existing set of files and folder.
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'
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...
.
Selecting the said option will popup a small window where the generator names are displayed. Here, select the controller
template.
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
.
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.
You can test the generated SDK and the server with automatically generated test cases as follows:
- From terminal/cmd navigate to the root directory of the SDK.
- Invoke:
bundle exec rake
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'
.
- CountriesController
- SMSController
- VoiceController
- AccountController
- SubaccountController
- ContactListController
- ContactController
- NumberController
- StatisticsController
- EmailToSmsController
- SearchController
- ReferralAccountController
- ResellerAccountController
- TransferCreditController
- AccountRechargeController
- SmsCampaignController
- PostLetterController
- PostReturnAddressController
- FaxController
- MMSController
- PostPostcardController
- UploadController
- PostDirectMailController
The singleton instance of the CountriesController
class can be accessed from the API Client.
countries_controller = client.countries
Tags:
Skips Authentication
Get all countries
def get_countries; end
result = countries_controller.get_countries()
The singleton instance of the SMSController
class can be accessed from the API Client.
sMS_controller = client.sms
Send one or more SMS messages
def send_sms(sms_messages); end
Parameter | Tags | Description |
---|---|---|
sms_messages | Required |
SmsMessageCollection model |
sms_messages = SmsMessageCollection.new
result = sMS_controller.send_sms(sms_messages)
Calculate sms price
def calculate_price(sms_messages); end
Parameter | Tags | Description |
---|---|---|
sms_messages | Required |
SmsMessageCollection model |
sms_messages = SmsMessageCollection.new
result = sMS_controller.calculate_price(sms_messages)
Export all sms history
def export_history(filename); end
Parameter | Tags | Description |
---|---|---|
filename | Required |
Filename to download history as |
filename = 'filename'
result = sMS_controller.export_history(filename)
Add a delivery receipt
def create_receipt(url); end
Parameter | Tags | Description |
---|---|---|
url | Required |
Your url |
url = 'url'
result = sMS_controller.create_receipt(url)
Marked delivery receipts as read
def mark_receipts_as_read(date_before = nil); end
Parameter | Tags | Description |
---|---|---|
date_before | Optional |
Mark all as read before this timestamp |
date_before = 'date_before'
result = sMS_controller.mark_receipts_as_read(date_before)
Get all inbound sms
def get_inbound_sms; end
result = sMS_controller.get_inbound_sms()
Create inbound sms
def create_inbound_sms(url); end
Parameter | Tags | Description |
---|---|---|
url | Required |
Your url |
url = 'url'
result = sMS_controller.create_inbound_sms(url)
Update scheduled message as cancel
def cancel_scheduled_sms(message_id); end
Parameter | Tags | Description |
---|---|---|
message_id | Required |
The message ID you want to cancel |
message_id = 'message_id'
result = sMS_controller.cancel_scheduled_sms(message_id)
Update all scheduled message as cancelled
def cancel_all_scheduled_sms; end
result = sMS_controller.cancel_all_scheduled_sms()
Create sms template
def create_sms_template(sms_template); end
Parameter | Tags | Description |
---|---|---|
sms_template | Required |
SmsTemplate model |
sms_template = SmsTemplate.new
result = sMS_controller.create_sms_template(sms_template)
Delete sms template
def delete_sms_template(template_id); end
Parameter | Tags | Description |
---|---|---|
template_id | Required |
Template id |
template_id = 218
result = sMS_controller.delete_sms_template(template_id)
Update sms template
def update_sms_template(template_id,
sms_template); end
Parameter | Tags | Description |
---|---|---|
template_id | Required |
Template id |
sms_template | Required |
Template item |
template_id = 218
sms_template = SmsTemplate.new
result = sMS_controller.update_sms_template(template_id, sms_template)
Get all delivery receipts
def get_delivery_receipts; end
result = sMS_controller.get_delivery_receipts()
Get lists of all sms templates
def get_sms_templates; end
result = sMS_controller.get_sms_templates()
Mark all inbound SMS as read optionally before a certain date
def mark_all_inbound_sms_as_read(date_before = nil); end
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. |
date_before = 'date_before'
result = sMS_controller.mark_all_inbound_sms_as_read(date_before)
Get a Specific Delivery Receipt
def get_specific_delivery_receipt(message_id); end
Parameter | Tags | Description |
---|---|---|
message_id | Required |
Message ID |
message_id = 'message_id'
result = sMS_controller.get_specific_delivery_receipt(message_id)
Get all sms history
def get_sms_history(date_from = nil,
date_to = nil); end
Parameter | Tags | Description |
---|---|---|
date_from | Optional |
Start date |
date_to | Optional |
End date |
date_from = 218
date_to = 218
result = sMS_controller.get_sms_history(date_from, date_to)
The singleton instance of the VoiceController
class can be accessed from the API Client.
voice_controller = client.voice
Send a voice call
def send_voice(voice_messages); end
Parameter | Tags | Description |
---|---|---|
voice_messages | Required |
VoiceMessageCollection model |
voice_messages = VoiceMessageCollection.new
result = voice_controller.send_voice(voice_messages)
Calculate voice price
def calculate_price(voice_messages); end
Parameter | Tags | Description |
---|---|---|
voice_messages | Required |
VoiceMessageCollection model |
voice_messages = VoiceMessageCollection.new
result = voice_controller.calculate_price(voice_messages)
Get all voice languages
def get_voice_languages; end
result = voice_controller.get_voice_languages()
Get all voice receipts
def get_voice_receipts; end
result = voice_controller.get_voice_receipts()
Update voice message status as cancelled
def cancel_voice_message(message_id); end
Parameter | Tags | Description |
---|---|---|
message_id | Required |
Your voice message id |
message_id = 'message_id'
result = voice_controller.cancel_voice_message(message_id)
Update all voice messages as cancelled
def cancel_voice_messages; end
result = voice_controller.cancel_voice_messages()
Export voice history
def export_voice_history(filename); end
Parameter | Tags | Description |
---|---|---|
filename | Required |
Filename to export to |
filename = 'filename'
result = voice_controller.export_voice_history(filename)
Get all voice history
def get_voice_history(date_from = nil,
date_to = nil); end
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 |
date_from = 218
date_to = 218
result = voice_controller.get_voice_history(date_from, date_to)
The singleton instance of the AccountController
class can be accessed from the API Client.
account_controller = client.account
Get account details
def get_account; end
result = account_controller.get_account()
Create An Account
def create_account(account); end
Parameter | Tags | Description |
---|---|---|
account | Required |
Account model |
account = Account.new
result = account_controller.create_account(account)
Send account activation token
def account_verify_send(account_verify); end
Parameter | Tags | Description |
---|---|---|
account_verify | Required |
Account details |
account_verify = AccountVerify.new
result = account_controller.account_verify_send(account_verify)
Verify new account
def account_verify(activation_token); end
Parameter | Tags | Description |
---|---|---|
activation_token | Required |
TODO: Add a parameter description |
activation_token = 218
result = account_controller.account_verify(activation_token)
Tags:
Skips Authentication
Forgot username
def forgot_username(email); end
Parameter | Tags | Description |
---|---|---|
Required |
Email belonging to account |
email = 'email'
result = account_controller.forgot_username(email)
Forgot password
def forgot_password(username); end
Parameter | Tags | Description |
---|---|---|
username | Required |
Username belonging to account |
username = 'username'
result = account_controller.forgot_password(username)
Verify forgot password
def verify_forgot_password(verify_password); end
Parameter | Tags | Description |
---|---|---|
verify_password | Required |
verifyPassword data |
verify_password = AccountForgotPasswordVerify.new
result = account_controller.verify_forgot_password(verify_password)
The singleton instance of the SubaccountController
class can be accessed from the API Client.
subaccount_controller = client.subaccount
Get all subaccounts
def get_subaccounts; end
result = subaccount_controller.get_subaccounts()
Create new subaccount
def create_subaccount(subaccount); end
Parameter | Tags | Description |
---|---|---|
subaccount | Required |
Subaccount model |
subaccount = Subaccount.new
result = subaccount_controller.create_subaccount(subaccount)
Get specific subaccount
def get_subaccount(subaccount_id); end
Parameter | Tags | Description |
---|---|---|
subaccount_id | Required |
ID of subaccount to get |
subaccount_id = 218
result = subaccount_controller.get_subaccount(subaccount_id)
Delete a subaccount
def delete_subaccount(subaccount_id); end
Parameter | Tags | Description |
---|---|---|
subaccount_id | Required |
ID of subaccount to delete |
subaccount_id = 218
result = subaccount_controller.delete_subaccount(subaccount_id)
Regenerate an API Key
def regenerate_api_key(subaccount_id); end
Parameter | Tags | Description |
---|---|---|
subaccount_id | Required |
ID of subaccount to regenerate API key for |
subaccount_id = 218
result = subaccount_controller.regenerate_api_key(subaccount_id)
Update subaccount
def update_subaccount(subaccount_id,
subaccount); end
Parameter | Tags | Description |
---|---|---|
subaccount_id | Required |
ID of subaccount to update |
subaccount | Required |
Subaccount model |
subaccount_id = 218
subaccount = Subaccount.new
result = subaccount_controller.update_subaccount(subaccount_id, subaccount)
The singleton instance of the ContactListController
class can be accessed from the API Client.
contactList_controller = client.contact_list
Get all contact lists
def get_contact_lists; end
result = contactList_controller.get_contact_lists()
Create new contact list
def create_contact_list(list_name); end
Parameter | Tags | Description |
---|---|---|
list_name | Required |
Your contact list name |
list_name = 'list_name'
result = contactList_controller.create_contact_list(list_name)
Get specific contact list
def get_contact_list(list_id); end
Parameter | Tags | Description |
---|---|---|
list_id | Required |
List ID |
list_id = 218
result = contactList_controller.get_contact_list(list_id)
Delete a specific contact list
def delete_contact_list(list_id); end
Parameter | Tags | Description |
---|---|---|
list_id | Required |
List ID |
list_id = 218
result = contactList_controller.delete_contact_list(list_id)
Remove duplicate contacts
def remove_duplicate_contacts(list_id); end
Parameter | Tags | Description |
---|---|---|
list_id | Required |
Your list id |
list_id = 218
result = contactList_controller.remove_duplicate_contacts(list_id)
Update specific contact list
def update_contact_list(list_id,
list_name); end
Parameter | Tags | Description |
---|---|---|
list_id | Required |
Your list id |
list_name | Required |
Your new list name |
list_id = 218
list_name = 'list_name'
result = contactList_controller.update_contact_list(list_id, list_name)
Import contacts to list
def import_contacts_to_list(list_id,
file); end
Parameter | Tags | Description |
---|---|---|
list_id | Required |
Your contact list id you want to access. |
file | Required |
ContactListImport model |
list_id = 218
file = ContactListImport.new
result = contactList_controller.import_contacts_to_list(list_id, file)
The singleton instance of the ContactController
class can be accessed from the API Client.
contact_controller = client.contact
Create new contact
def create_contact(contact,
list_id); end
Parameter | Tags | Description |
---|---|---|
contact | Required |
Contact model |
list_id | Required |
List id |
contact = Contact.new
list_id = 218
result = contact_controller.create_contact(contact, list_id)
Get a specific contact
def get_contact(list_id,
contact_id); end
Parameter | Tags | Description |
---|---|---|
list_id | Required |
Your contact list id you want to access. |
contact_id | Required |
Your contact id you want to access. |
list_id = 218
contact_id = 218
result = contact_controller.get_contact(list_id, contact_id)
Update contact
def update_contact(list_id,
contact_id,
contact); end
Parameter | Tags | Description |
---|---|---|
list_id | Required |
Contact list id |
contact_id | Required |
Contact ID |
contact | Required |
Contact model |
list_id = 218
contact_id = 218
contact = Contact.new
result = contact_controller.update_contact(list_id, contact_id, contact)
Remove all opted out contacts
def remove_opted_out_contacts(list_id,
opt_out_list_id); end
Parameter | Tags | Description |
---|---|---|
list_id | Required |
Your list id |
opt_out_list_id | Required |
Your opt out list id |
list_id = 218
opt_out_list_id = 218
result = contact_controller.remove_opted_out_contacts(list_id, opt_out_list_id)
Delete a contact
def delete_contact(list_id,
contact_id); end
Parameter | Tags | Description |
---|---|---|
list_id | Required |
List ID |
contact_id | Required |
Contact ID |
list_id = 218
contact_id = 218
result = contact_controller.delete_contact(list_id, contact_id)
Get all contacts in a list
def get_contacts(list_id,
page_num = 1); end
Parameter | Tags | Description |
---|---|---|
list_id | Required |
Contact list ID |
page_num | Optional DefaultValue |
Page number |
list_id = 218
page_num = 1
result = contact_controller.get_contacts(list_id, page_num)
The singleton instance of the NumberController
class can be accessed from the API Client.
number_controller = client.number
Get all dedicated numbers
def get_dedicated_numbers; end
result = number_controller.get_dedicated_numbers()
Buy dedicated number
def purchase_dedicated_number(dedicated_number); end
Parameter | Tags | Description |
---|---|---|
dedicated_number | Required |
Phone number to purchase |
dedicated_number = 'dedicated_number'
result = number_controller.purchase_dedicated_number(dedicated_number)
Get all dedicated numbers by country
def get_dedicated_numbers_by_country(country,
search = nil,
search_type = nil); end
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. |
country = 'country'
search = 'search'
search_type = 218
result = number_controller.get_dedicated_numbers_by_country(country, search, search_type)
The singleton instance of the StatisticsController
class can be accessed from the API Client.
statistics_controller = client.statistics
Get voice statistics
def get_voice_statistics; end
result = statistics_controller.get_voice_statistics()
Get sms statistics
def get_sms_statistics; end
result = statistics_controller.get_sms_statistics()
The singleton instance of the EmailToSmsController
class can be accessed from the API Client.
emailToSms_controller = client.email_to_sms
Create email to sms allowed address
def create_allowed_address(email_sms_address); end
Parameter | Tags | Description |
---|---|---|
email_sms_address | Required |
EmailSMSAddress model |
email_sms_address = EmailSMSAddress.new
result = emailToSms_controller.create_allowed_address(email_sms_address)
Get list of email to sms allowed addresses
def get_allowed_address; end
result = emailToSms_controller.get_allowed_address()
The singleton instance of the SearchController
class can be accessed from the API Client.
search_controller = client.search
Get list of searched contact list
def search_contact_list(q); end
Parameter | Tags | Description |
---|---|---|
q | Required |
Your keyword or query. |
q = 'q'
result = search_controller.search_contact_list(q)
The singleton instance of the ReferralAccountController
class can be accessed from the API Client.
referralAccount_controller = client.referral_account
Get all referral accounts
def get_referral_accounts; end
result = referralAccount_controller.get_referral_accounts()
The singleton instance of the ResellerAccountController
class can be accessed from the API Client.
resellerAccount_controller = client.reseller_account
Get list of reseller accounts
def get_reseller_accounts; end
result = resellerAccount_controller.get_reseller_accounts()
Create reseller account
def create_reseller_account(reseller_account); end
Parameter | Tags | Description |
---|---|---|
reseller_account | Required |
ResellerAccount model |
reseller_account = ResellerAccount.new
result = resellerAccount_controller.create_reseller_account(reseller_account)
Get Reseller Account
def get_reseller_account(client_user_id); end
Parameter | Tags | Description |
---|---|---|
client_user_id | Required |
User ID of client |
client_user_id = 218
result = resellerAccount_controller.get_reseller_account(client_user_id)
Reseller Account
def update_reseller_account(client_user_id,
reseller_account); end
Parameter | Tags | Description |
---|---|---|
client_user_id | Required |
User ID of client |
reseller_account | Required |
ResellerAccount model |
client_user_id = 218
reseller_account = ResellerAccount.new
result = resellerAccount_controller.update_reseller_account(client_user_id, reseller_account)
The singleton instance of the TransferCreditController
class can be accessed from the API Client.
transferCredit_controller = client.transfer_credit
Transfer Credit
def transfer_credit(reseller_account_transfer_credit); end
Parameter | Tags | Description |
---|---|---|
reseller_account_transfer_credit | Required |
ResellerAccountTransferCredit model |
reseller_account_transfer_credit = ResellerAccountTransferCredit.new
result = transferCredit_controller.transfer_credit(reseller_account_transfer_credit)
The singleton instance of the AccountRechargeController
class can be accessed from the API Client.
accountRecharge_controller = client.account_recharge
Get Credit Card info
def get_credit_card_info; end
result = accountRecharge_controller.get_credit_card_info()
Update credit card info
def update_credit_card_info(credit_card); end
Parameter | Tags | Description |
---|---|---|
credit_card | Required |
CreditCard model |
credit_card = CreditCard.new
result = accountRecharge_controller.update_credit_card_info(credit_card)
Get list of all packages
def get_packages_list(country = nil); end
Parameter | Tags | Description |
---|---|---|
country | Optional |
Country code |
country = 'country'
result = accountRecharge_controller.get_packages_list(country)
Purchase a package
def purchase_package(package_id); end
Parameter | Tags | Description |
---|---|---|
package_id | Required |
ID of package to purchase |
package_id = 218
result = accountRecharge_controller.purchase_package(package_id)
Get all transactions
def get_transactions; end
result = accountRecharge_controller.get_transactions()
Get specific Transaction
def get_transaction(transaction_id); end
Parameter | Tags | Description |
---|---|---|
transaction_id | Required |
ID of transaction to retrieve |
transaction_id = 'transaction_id'
result = accountRecharge_controller.get_transaction(transaction_id)
The singleton instance of the SmsCampaignController
class can be accessed from the API Client.
smsCampaign_controller = client.sms_campaign
Create sms campaign
def create_sms_campaign(campaign); end
Parameter | Tags | Description |
---|---|---|
campaign | Required |
SmsCampaign model |
campaign = SmsCampaign.new
result = smsCampaign_controller.create_sms_campaign(campaign)
Calculate price for sms campaign
def calculate_price(campaign); end
Parameter | Tags | Description |
---|---|---|
campaign | Required |
SmsCampaign model |
campaign = SmsCampaign.new
result = smsCampaign_controller.calculate_price(campaign)
Update sms campaign
def update_sms_campaign(sms_campaign_id,
campaign); end
Parameter | Tags | Description |
---|---|---|
sms_campaign_id | Required |
ID of SMS campaign to update |
campaign | Required |
SmsCampaign model |
sms_campaign_id = 218
campaign = SmsCampaign.new
result = smsCampaign_controller.update_sms_campaign(sms_campaign_id, campaign)
Cancel sms campaign
def cancel_sms_campaign(sms_campaign_id); end
Parameter | Tags | Description |
---|---|---|
sms_campaign_id | Required |
ID of SMS Campaign to cancel |
sms_campaign_id = 218
result = smsCampaign_controller.cancel_sms_campaign(sms_campaign_id)
Get list of sms campaigns
def get_sms_campaigns; end
result = smsCampaign_controller.get_sms_campaigns()
Get specific sms campaign
def get_sms_campaign(sms_campaign_id); end
Parameter | Tags | Description |
---|---|---|
sms_campaign_id | Required |
ID of SMS campaign to retrieve |
sms_campaign_id = 218
result = smsCampaign_controller.get_sms_campaign(sms_campaign_id)
The singleton instance of the PostLetterController
class can be accessed from the API Client.
postLetter_controller = client.post_letter
Send post letter
def send_post_letter(post_letter); end
Parameter | Tags | Description |
---|---|---|
post_letter | Required |
PostLetter model |
post_letter = PostLetter.new
result = postLetter_controller.send_post_letter(post_letter)
Calculate post letter price
def calculate_price(post_letter); end
Parameter | Tags | Description |
---|---|---|
post_letter | Required |
PostLetter model |
post_letter = PostLetter.new
result = postLetter_controller.calculate_price(post_letter)
Get all post letter history
def get_post_letter_history; end
result = postLetter_controller.get_post_letter_history()
export post letter history
def export_post_letter_history(filename); end
Parameter | Tags | Description |
---|---|---|
filename | Required |
Filename to export to |
filename = 'filename'
result = postLetter_controller.export_post_letter_history(filename)
The singleton instance of the PostReturnAddressController
class can be accessed from the API Client.
postReturnAddress_controller = client.post_return_address
Create post return address
def create_post_return_address(return_address); end
Parameter | Tags | Description |
---|---|---|
return_address | Required |
Address model |
return_address = Address.new
result = postReturnAddress_controller.create_post_return_address(return_address)
Get list of post return addresses
def get_post_return_addresses; end
result = postReturnAddress_controller.get_post_return_addresses()
Get specific post return address
def get_post_return_address(return_address_id); end
Parameter | Tags | Description |
---|---|---|
return_address_id | Required |
Return address ID |
return_address_id = 218
result = postReturnAddress_controller.get_post_return_address(return_address_id)
Update post return address
def update_post_return_address(return_address_id,
return_address); end
Parameter | Tags | Description |
---|---|---|
return_address_id | Required |
Return address ID |
return_address | Required |
Address model |
return_address_id = 218
return_address = Address.new
result = postReturnAddress_controller.update_post_return_address(return_address_id, return_address)
Delete specific post return address
def delete_post_return_address(return_address_id); end
Parameter | Tags | Description |
---|---|---|
return_address_id | Required |
Return address ID |
return_address_id = 218
result = postReturnAddress_controller.delete_post_return_address(return_address_id)
The singleton instance of the FaxController
class can be accessed from the API Client.
fax_controller = client.fax
Get List of Fax Receipts
def fax_receipt_list; end
result = fax_controller.fax_receipt_list()
Get a single fax receipt based on message id.
def get_fax_receipt(message_id); end
Parameter | Tags | Description |
---|---|---|
message_id | Required |
ID of the message receipt to retrieve |
message_id = 'message_id'
result = fax_controller.get_fax_receipt(message_id)
Get a list of Fax History.
def get_fax_history(date_from = nil,
date_to = nil,
q = nil,
order = nil); end
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. |
date_from = 55
date_to = 55
q = 'q'
order = 'order'
result = fax_controller.get_fax_history(date_from, date_to, q, order)
Calculate Total Price for Fax Messages sent
def calculate_price(fax_message); end
Parameter | Tags | Description |
---|---|---|
fax_message | Required |
FaxMessageCollection model |
fax_message = FaxMessageCollection.new
result = fax_controller.calculate_price(fax_message)
Send a fax using supplied supported file-types.
def send_fax(fax_message); end
Parameter | Tags | Description |
---|---|---|
fax_message | Required |
FaxMessageCollection model |
fax_message = FaxMessageCollection.new
result = fax_controller.send_fax(fax_message)
The singleton instance of the MMSController
class can be accessed from the API Client.
mMS_controller = client.mms
TODO: Add a method description
def send_mms(mms_messages); end
Parameter | Tags | Description |
---|---|---|
mms_messages | Required |
MmsMessageCollection model |
mms_messages = MmsMessageCollection.new
result = mMS_controller.send_mms(mms_messages)
Get Price for MMS sent
def get_price(mms_messages); end
Parameter | Tags | Description |
---|---|---|
mms_messages | Required |
MmsMessageCollection model |
mms_messages = MmsMessageCollection.new
result = mMS_controller.get_price(mms_messages)
The singleton instance of the PostPostcardController
class can be accessed from the API Client.
postPostcard_controller = client.post_postcard
Send one or more postcards
def send_postcard(post_postcards); end
Parameter | Tags | Description |
---|---|---|
post_postcards | Required |
PostPostcard model |
post_postcards = PostPostcard.new
result = postPostcard_controller.send_postcard(post_postcards)
Calculate price for sending one or more postcards
def calculate_price(post_postcards); end
Parameter | Tags | Description |
---|---|---|
post_postcards | Required |
PostPostcard model |
post_postcards = PostPostcard.new
result = postPostcard_controller.calculate_price(post_postcards)
Retrieve the history of postcards sent or scheduled
def get_postcard_history; end
result = postPostcard_controller.get_postcard_history()
Export postcard history to a CSV file
def export_postcard_history(filename); end
Parameter | Tags | Description |
---|---|---|
filename | Required |
Filename to export to |
filename = 'filename'
result = postPostcard_controller.export_postcard_history(filename)
The singleton instance of the UploadController
class can be accessed from the API Client.
upload_controller = client.upload
Upload a file
def upload_file(file,
convert); end
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' |
file = Faraday::UploadIO.new('PathToFile', 'application/octet-stream')
convert = 'convert'
result = upload_controller.upload_file(file, convert)
TODO: Add a method description
def upload_file1(content,
convert); end
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' |
content = FileContent.new
convert = 'convert'
result = upload_controller.upload_file1(content, convert)
The singleton instance of the PostDirectMailController
class can be accessed from the API Client.
postDirectMail_controller = client.post_direct_mail
Search for a location
def location_search(country,
q); end
Parameter | Tags | Description |
---|---|---|
country | Required |
Country Code to search |
q | Required |
Search term (e.g. post code, city name) |
country = 'country'
q = 'q'
result = postDirectMail_controller.location_search(country, q)
TODO: Add a method description
def send_campaign(post_direct_mail); end
Parameter | Tags | Description |
---|---|---|
post_direct_mail | Required |
PostDirectMail model |
post_direct_mail = PostDirectMail.new
result = postDirectMail_controller.send_campaign(post_direct_mail)
Calculate direct mail campaign price
def calculate_price(post_direct_mail); end
Parameter | Tags | Description |
---|---|---|
post_direct_mail | Required |
PostDirectMail model |
post_direct_mail = PostDirectMail.new
result = postDirectMail_controller.calculate_price(post_direct_mail)
Get direct mail campaigns
def campaigns; end
result = postDirectMail_controller.campaigns()