Class: WHMCS::Misc

Inherits:
Base
  • Object
show all
Defined in:
lib/whmcs/misc.rb

Overview

The WHMCS::Misc class contains miscelaneous WHMCS API functions

Class Method Summary collapse

Methods inherited from Base

parse_response, send_request

Class Method Details

.decrypt_password(params = {}) ⇒ Object

Decrypt a string with the WHMCS algorithm

NOTE: This cannot be used to decrypt the clients password.

Parameters:

  • :password2 - should contain the string you want decrypting

See:

wiki.whmcs.com/API:Decrypt_Password



163
164
165
166
# File 'lib/whmcs/misc.rb', line 163

def self.decrypt_password(params = {})
  params.merge!(:action => 'decryptpassword')
  send_request(params)
end

.domain_whois(params = {}) ⇒ Object

Perform a whois lookup for a domain name

Parameters:

  • :domain - the domain to check

See:

wiki.whmcs.com/API:Domain_WHOIS



14
15
16
17
# File 'lib/whmcs/misc.rb', line 14

def self.domain_whois(params = {})
  params.merge!(:action => 'domainwhois')
  send_request(params)
end

.encrypt_password(params = {}) ⇒ Object

Encrypt a password with the WHMCS algorithm

Parameters:

  • :password2 - should contain the string you want encrypting

See:

wiki.whmcs.com/API:Encrypt_Password



147
148
149
150
# File 'lib/whmcs/misc.rb', line 147

def self.encrypt_password(params = {})
  params.merge!(:action => 'encryptpassword')
  send_request(params)
end

.get_activity_log(params = {}) ⇒ Object

Get activity log

Parameters:

  • :limitstart - Which User ID to start at (default = 0)

  • :limitnum - Limit by number (default = 25)

See:

wiki.whmcs.com/API:Get_Activity_Log



29
30
31
32
# File 'lib/whmcs/misc.rb', line 29

def self.get_activity_log(params = {})
  params.merge!(:action => 'getactivitylog')
  send_request(params)
end

.get_admin_detailsObject

Get administrator details

See:

wiki.whmcs.com/API:Get_Admin_Details



39
40
41
# File 'lib/whmcs/misc.rb', line 39

def self.get_admin_details
  send_request(:action => 'getadmindetails')
end

.get_currenciesObject

Get allowed currencies

See:

wiki.whmcs.com/API:Get_Currencies



62
63
64
# File 'lib/whmcs/misc.rb', line 62

def self.get_currencies
  send_request(:action => 'getcurrencies')
end

.get_email_templates(params = {}) ⇒ Object

Get email templates

Parameters:

  • :type - optional - from product,domain,support,general,invoice,affiliate

  • :language - optional - only required for additional languages

See:

wiki.whmcs.com/API:Get_Email_Templates



92
93
94
95
# File 'lib/whmcs/misc.rb', line 92

def self.get_email_templates(params = {})
  params.merge!(:action => 'getemailtemplates')
  send_request(params)
end

.get_promotions(params = {}) ⇒ Object

Get promotions

Note: WHMCS has this listed under Misc as well as invoices. It’s aliased here for consistancy with their API docs

Parameters:

  • :code - the specific promotion code to return information for (optional)

See:

wiki.whmcs.com/API:Get_Promotions



78
79
80
# File 'lib/whmcs/misc.rb', line 78

def self.get_promotions(params = {})
  Invoice.get_promotions(params)
end

.get_staff_onlineObject

Get staff online

See:

wiki.whmcs.com/API:Get_Staff_Online



125
126
127
# File 'lib/whmcs/misc.rb', line 125

def self.get_staff_online
  send_request(:action => 'getstaffonline')
end

.get_statsObject



134
135
136
# File 'lib/whmcs/misc.rb', line 134

def self.get_stats
  send_request(:action => 'getstats')
end

.get_todo_item_statusesObject

Get configured todo item statuses

See:

wiki.whmcs.com/API:Get_To-Do_Items_Statuses



116
117
118
# File 'lib/whmcs/misc.rb', line 116

def self.get_todo_item_statuses
  send_request(:action => 'gettodoitemstatuses')
end

.get_todo_items(params = {}) ⇒ Object

Get todo items

Parameters:

  • :status - optional - from New,Pending,In Progress,Completed,Postponed

See:

wiki.whmcs.com/API:Get_To-Do_Items



106
107
108
109
# File 'lib/whmcs/misc.rb', line 106

def self.get_todo_items(params = {})
  params.merge!(:action => 'gettodoitems')
  send_request(params)
end

.update_admin_notes(params = {}) ⇒ Object

Update administrator notes

Parameters:

  • :notes - notes to enter

See:

wiki.whmcs.com/API:Update_Admin_Notes



52
53
54
55
# File 'lib/whmcs/misc.rb', line 52

def self.update_admin_notes(params = {})
  params.merge!(:action => 'updateadminnotes')
  send_request(params)
end