Class: WHMCS::Ticket

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

Overview

WHMCS::Ticket is the class for managing support tickets

Class Method Summary collapse

Methods inherited from Base

parse_response, send_request

Class Method Details

.add_ticket_note(params = {}) ⇒ Object

Add a note to an existing ticket

Parameters:

  • :ticketid - Ticket ID the note is to be added

  • :message - The not to add

See:

wiki.whmcs.com/API:Add_Ticket_Note



107
108
109
110
# File 'lib/whmcs/ticket.rb', line 107

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

.delete_ticket(params = {}) ⇒ Object

Delete an existing ticket

Parameters:

  • :ticketid - Ticket ID to be deleted

See:

wiki.whmcs.com/API:Delete_Ticket



121
122
123
124
# File 'lib/whmcs/ticket.rb', line 121

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

.get_support_departmentsObject

Get support departments

See:

wiki.whmcs.com/API:Get_Support_Departments



131
132
133
# File 'lib/whmcs/ticket.rb', line 131

def self.get_support_departments
  send_request(:action => 'getsupportdepartments')
end

.get_support_statuses(params = {}) ⇒ Object

Get support statuses

Parameters:

  • :deptid - Optional - Send a Department ID to limit results

See:

wiki.whmcs.com/API:Get_Support_Statuses



144
145
146
147
# File 'lib/whmcs/ticket.rb', line 144

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

.get_ticket(params = {}) ⇒ Object

Get a ticket

Parameters:

  • :ticketid - Ticket id to retrieve

See:

wiki.whmcs.com/API:Get_Ticket



75
76
77
78
# File 'lib/whmcs/ticket.rb', line 75

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

.get_ticket_predefined_catsObject

Get ticket predefined categories

See:

wiki.whmcs.com/API:Get_Ticket_Predefined_Cats



154
155
156
# File 'lib/whmcs/ticket.rb', line 154

def self.get_ticket_predefined_cats
  send_request(:action => 'getticketpredefinedcats')
end

.get_ticket_predefined_repies(params = {}) ⇒ Object

Get ticket predefined replies

Parameters:

  • :catid - Optional Select category to browse

See:

wiki.whmcs.com/API:Get_Ticket_Predefined_Replies



167
168
169
170
# File 'lib/whmcs/ticket.rb', line 167

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

.get_tickets(params = {}) ⇒ Object

Get tickets

Parameters:

  • :limitstart - Optional start at which result (default 0)

  • :limitnum - Optional limit at how many results (default 25)

  • :clientid - Optional search for a particular client’s tickets

  • :deptid - Optional search in a particular department

  • :status - Optional search a particular status

  • :subject - Optional search for a word in the subject

See:

wiki.whmcs.com/API:Get_Tickets



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

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

.open_ticket(params = {}) ⇒ Object

Open a new ticket

Parameters:

  • :clientid - the ID of the client the ticket belongs to

  • :name - only required if not a registered client (clientid must be sent as 0)

  • :email - only required if not a registered client

  • :deptid - the ID of the ticket department

  • :subject

  • :message

  • :priority - can be “Low”, “Medium” or “High”

  • :serviceid - the ID if the ticket relates to a specific product

  • :customfields - a base 64 serialized array of field IDs => values

See:

wiki.whmcs.com/API:Open_Ticket



22
23
24
25
# File 'lib/whmcs/ticket.rb', line 22

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

.reply_ticket(params = {}) ⇒ Object

Reply to ticket

Parameters:

  • :ticketid - the ID of the ticket to add the reply to

  • :clientid - if adding reply as a client

  • :name - only required if not a registered client (clientid must be sent as 0)

  • :email - only required if not a registered client

  • :adminusername - if adding reply as an admin, name to show

  • :message

  • :status - specify if you want to set the status to On Hold or In Progress after reply

See:

wiki.whmcs.com/API:Reply_Ticket



42
43
44
45
# File 'lib/whmcs/ticket.rb', line 42

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

.update_ticket(params = {}) ⇒ Object

Update an existing ticket

Parameters:

  • :ticketid - Ticket ID to be updated

  • :subject

  • :priority - Low, Medium or High

  • :status - Open, Answered, Closed, etc…

See:

wiki.whmcs.com/API:Update_Ticket



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

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