Assign Ticket Editor
Function
As of version 5.2.5.0
POST /api/v2/api.php p_ticketeditor_assign=1
|
Filters
Name |
POST Key |
Type |
Required |
Comment |
Example |
|
CURL Example
curl {yourdomain}{livezilla_folder}/api/v2/api.php -d {authenthication} -d p_ticketeditor_assign=1 -d p_data={
"TicketEditor": {
"SubStatus": "Sub-Status Name",
"Id": "11123",
"Editor": "john_doe",
"Status": "0"
}
} -X POST
|
Response
200 Ok: {
"TicketEditor": {
"SubStatus": "Sub-Status Name",
"Id": "11123",
"Editor": "john_doe",
"Status": "0"
}
}
|
Error Codes
403 Forbidden: Invalid or no user authentication data sent (see General API Authentication)
400 Bad Data: Invalid or missing POST parameters (see required fields/filters and data types)
|
Example: PHP code to assign an operator to a ticket
<?php
$livezillaURL = "http(s)://{yourdomain}/livezilla/";
$apiURL = $livezillaURL . "api/v2/api.php";
// authentication parameters
$postd["p_user"]='{user_id}';
$postd["p_pass"]=md5('{user_password}');
// function parameter
$postd["p_ticketeditor_assign"]=1;
$postd["p_json_pretty"]=1;
class TicketEditor
{
public $Id = "11967";
public $Editor = "john_doe";
}
$neweditor = new TicketEditor();
$postd["p_data"]= json_encode(array("TicketEditor"=>$neweditor));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$apiURL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($postd));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
if($server_output === false)
exit(curl_error($ch));
echo $server_output;
curl_close($ch);
?>