API:Open Ticket

From WHMCS Documentation

Jump to: navigation, search

This command is used to create a new ticket in WHMCS

Attributes

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

Example Command

$postfields["action"] = "openticket"; 
$postfields["clientid"] = "1";
$postfields["deptid"] = "1";
$postfields["subject"] = "API Ticket";
$postfields["message"] = "This is a sample ticket opened by the API";
$postfields["priority"] = "Low";
$postfields["customfields"] = base64_encode(serialize(array("8"=>"mydomain.com")));

Returned Variables

id - the ID of the new ticket
tid - the 6 digit Ticket ID
c - the unique hash variable

About the API System · Example API Usage · API Functions

API Functions
Add Client - Update Client - Delete Client - Get Clients - Get Clients Details - Get Clients Products - Get Clients Password - Send Email
Get Support Departments - Get Support Statuses - Get Tickets - Get Ticket - Get Ticket Predefined Cats - Get Ticket Predefined Replies
Open Ticket - Reply Ticket - Add Ticket Note - Delete Ticket
Module Create - Module Suspend - Module Unsuspend - Module Terminate
Create Quote - Update Quote - Delete Quote - Send Quote - Accept Quote
Get Orders - Get Order Statuses - Add Order - Accept Order - Pending Order - Cancel Order - Fraud Order - Delete Order
Get Invoice - Get Payment Methods - Create Invoice - Add Billable Item - Add Invoice Payment
Add Transaction - Add Credit - Capture Payment
Domain WHOIS Lookup - Get Activity Log - Get Admin Details - Update Admin Notes - Get Currencies - Get Email Templates
Get To-Do Items - Get To-Do Item Statuses - Get Staff Online - Get Stats - Encrypt Password - Decrypt Password