Constructor
new Support(config)
Parameters:
Name |
Type |
Description |
config |
Object
|
Object containing your API credentials.
Properties
Name |
Type |
Attributes |
Description |
serverUrl |
string
|
|
URL to your installation. Remember to point to /includes/api.php |
username |
string
|
<optional>
|
|
password |
string
|
<optional>
|
|
identifier |
string
|
<optional>
|
|
secret |
string
|
<optional>
|
|
|
- Source:
Extends
Methods
addAnouncement(opts)
Adds an announcement. - https://developers.whmcs.com/api-reference/addannouncement/
Parameters:
Name |
Type |
Description |
opts |
Object
|
Properties
Name |
Type |
Attributes |
Description |
date |
String
|
|
Date in the format YYYY-MM-DD HH:MM:SS |
title |
String
|
|
|
announcement |
String
|
|
Announcement text |
published |
Boolean
|
<optional>
|
Pass as true to publish |
|
- Source:
addCancelRequest(opts)
Adds a Cancellation Request - https://developers.whmcs.com/api-reference/addcancelrequest/
Parameters:
Name |
Type |
Description |
opts |
Object
|
Properties
Name |
Type |
Attributes |
Description |
serviceid |
Number
|
|
The Service ID to cancel |
type |
String
|
<optional>
|
The type of cancellation. ‘Immediate’ or ‘End of Billing Period’ |
reason |
String
|
<optional>
|
The customer reason for cancellation |
|
- Source:
addClientNote(opts)
Adds a Client Note - https://developers.whmcs.com/api-reference/addclientnote/
Parameters:
Name |
Type |
Description |
opts |
Object
|
Properties
Name |
Type |
Attributes |
Description |
userid |
Number
|
|
The Client ID to apply the note to |
notes |
String
|
|
The note to add |
sticky |
Boolean
|
<optional>
|
Should the note be made sticky. Makes the note ‘sticky’ and displays the note throughout the client’s account and on any tickets they submit in the admin area |
|
- Source:
addTicketNote(opts)
Add a note to a ticket by Ticket ID or Ticket Number. - https://developers.whmcs.com/api-reference/addticketnote/
Parameters:
Name |
Type |
Description |
opts |
Object
|
Properties
Name |
Type |
Attributes |
Description |
message |
String
|
|
The content of the ticket note |
ticketnum |
String
|
<optional>
|
The Client Ticket Number ID to apply the note to |
ticketid |
Number
|
<optional>
|
The id of the ticket in the database. Either $ticketnum or $ticketid is required |
markdown |
Boolean
|
<optional>
|
Should markdown be used on the ticket note output |
attachments |
Array
|
<optional>
|
Optional base64 json encoded array of file attachments. Can be the direct output of a multipart-form-data form submission ($_FILES superglobal in PHP) or an array of arrays consisting of both a filename and data keys (see example below). |
|
- Source:
addTicketReply(opts)
Add a reply to a ticket by Ticket ID. - https://developers.whmcs.com/api-reference/addticketreply/
Parameters:
Name |
Type |
Description |
opts |
Object
|
Properties
Name |
Type |
Attributes |
Description |
ticketid |
Number
|
|
The id of the ticket in the database. Either $ticketnum or $ticketid is required |
message |
String
|
|
The content of the ticket reply |
markdown |
Boolean
|
<optional>
|
Should markdown be used on the ticket reply output |
clientid |
Number
|
<optional>
|
Pass a clientid to associate the ticket reply with a specific client |
contactid |
Number
|
<optional>
|
Pass a contactid to associate the ticket reply with a specific contact belonging to $clientid |
adminusername |
String
|
<optional>
|
The admin username to associate the ticket reply with |
name |
String
|
<optional>
|
The name to associate with the ticket reply if not an admin or client response |
email |
String
|
<optional>
|
The email to associate with the ticket reply if not an admin or client response |
status |
String
|
<optional>
|
The status to set on the ticket after the reply is made if the default status on admin/client response is not required. See GetSupportStatuses API command |
noemail |
Boolean
|
<optional>
|
Set to true to stop the ticket reply email being sent |
customfields |
String
|
<optional>
|
A base64 encoded array of the custom fields to update |
attachments |
Array
|
<optional>
|
Optional base64 json encoded array of file attachments. Can be the direct output of a multipart-form-data form submission ($_FILES superglobal in PHP) or an array of arrays consisting of both a filename and data keys (see example below). |
|
- Source:
deleteAnnouncement(opts)
Delete an announcement - https://developers.whmcs.com/api-reference/deleteannouncement/
Parameters:
Name |
Type |
Description |
opts |
Object
|
Properties
Name |
Type |
Description |
announcementid |
Number
|
The id of the announcement to be deleted |
|
- Source:
deleteTicket(opts)
Removes a ticket and all replies from the system. This cannot be undone. - https://developers.whmcs.com/api-reference/deleteticket/
Parameters:
Name |
Type |
Description |
opts |
Object
|
Properties
Name |
Type |
Description |
ticketid |
Number
|
The ticket to be deleted |
|
- Source:
deleteTicketNote(opts)
Removes a ticket note from the system. This cannot be undone. - https://developers.whmcs.com/api-reference/deleteticketnote/
Parameters:
Name |
Type |
Description |
opts |
Object
|
Properties
Name |
Type |
Description |
noteid |
Number
|
The ticket note to be deleted |
|
- Source:
getAnnouncements(opts)
Obtain an array of announcements - https://developers.whmcs.com/api-reference/getannouncements/
Parameters:
Name |
Type |
Description |
opts |
Object
|
Properties
Name |
Type |
Attributes |
Description |
limitstart |
Number
|
<optional>
|
The offset for the returned announcement data (default: 0) |
limitnum |
Number
|
<optional>
|
The number of records to return (default: 25) |
|
- Source:
openTicket(opts)
Open a new ticket - https://developers.whmcs.com/api-reference/openticket/
Parameters:
Name |
Type |
Description |
opts |
Object
|
Properties
Name |
Type |
Attributes |
Description |
deptid |
Number
|
|
The department to open the ticket in |
subject |
String
|
|
The subject of the ticket |
message |
String
|
|
The message of the ticket |
clientid |
Number
|
<optional>
|
If applicable, the Client ID to create the ticket for. |
contactid |
Number
|
<optional>
|
If applicable, the Contact ID to create the ticket for (only if $clientid is passed). |
name |
String
|
<optional>
|
The name of the person opening the ticket (if not a client) |
email |
String
|
<optional>
|
The email address of the person opening the ticket (if not a client) |
priority |
String
|
<optional>
|
The priority of the ticket (‘Low’, ‘Medium’, ‘High’) |
serviceid |
Number
|
<optional>
|
The service to associate the ticket with (only one of $serviceid or $domainid) |
domainid |
Number
|
<optional>
|
The domain to associate the ticket with (only one of $serviceid or $domainid) |
admin |
Boolean
|
<optional>
|
Is an Admin opening the ticket |
markdown |
Boolean
|
<optional>
|
Should markdown be used on the ticket output |
customfields |
String
|
<optional>
|
Base64 encoded serialized array of custom field values |
attachments |
Array
|
<optional>
|
Optional base64 json encoded array of file attachments. Can be the direct output of a multipart-form-data form submission ($_FILES superglobal in PHP) or an array of arrays consisting of both a filename and data keys (see example below). |
|
- Source:
updateTicket(opts)
Updates an existing ticket - https://developers.whmcs.com/api-reference/updateticket/
Parameters:
Name |
Type |
Description |
opts |
Object
|
Properties
Name |
Type |
Attributes |
Description |
ticketid |
Number
|
|
The ticket Id to update |
deptid |
Number
|
<optional>
|
The department id of the ticket |
status |
String
|
<optional>
|
The status of the ticket |
subject |
String
|
<optional>
|
The subject of the ticket |
userid |
Number
|
<optional>
|
If applicable, the Client ID to update the ticket for. |
name |
String
|
<optional>
|
The name of the person opening the ticket (if not a client) |
email |
String
|
<optional>
|
The email address of the person opening the ticket (if not a client) |
cc |
String
|
<optional>
|
The cc email addresses for the ticket |
priority |
String
|
<optional>
|
The priority of the ticket (‘Low’, ‘Medium’, ‘High’) |
flag |
Number
|
<optional>
|
The id of the admin to flag the ticket to |
removeFlag |
Boolean
|
<optional>
|
Remove the flag from the ticket |
message |
String
|
<optional>
|
Update the ticket message |
markdown |
Boolean
|
<optional>
|
Should markdown be used on the ticket output. |
customfields |
String
|
<optional>
|
Base64 encoded serialized array of custom field values |
|
- Source:
updateTicketReply(opts)
Updates a ticket reply message. - https://developers.whmcs.com/api-reference/updateticketreply/
Parameters:
Name |
Type |
Description |
opts |
Object
|
Properties
Name |
Type |
Attributes |
Description |
replyid |
Number
|
|
The reply id to update. |
message |
String
|
|
The message to be updated |
markdown |
Boolean
|
<optional>
|
Should markdown be used on the ticket message. Existing value is used if not supplied. |
|
- Source: