Open jimkaler123 opened 2 years ago
I am using same example code to create ticket with custom fields like below (even checked in Postman):
$custom_fields = array("mobile" => 5788394511 );
$ticket_data = json_encode(array( "description" => "Some details on the issue ...", "subject" => "Support needed..", "email" => "tom@outerspace.com", "priority" => 1, "status" => 2, "cc_emails" => array("ram@freshdesk.com", "diana@freshdesk.com"), "custom_fields" => $custom_fields ));
But I am getting error which says:
{"description":"Validation failed","errors":[{"field":"type","message":"Unexpected/invalid field in request","code":"invalid_field"}]}
I just ran into this and found a solution. Format them like this:
"custom_fields[mobile]" => "5788394511"
I am using same example code to create ticket with custom fields like below (even checked in Postman):
$custom_fields = array("mobile" => 5788394511 );
$ticket_data = json_encode(array( "description" => "Some details on the issue ...", "subject" => "Support needed..", "email" => "tom@outerspace.com", "priority" => 1, "status" => 2, "cc_emails" => array("ram@freshdesk.com", "diana@freshdesk.com"), "custom_fields" => $custom_fields ));
But I am getting error which says:
{"description":"Validation failed","errors":[{"field":"type","message":"Unexpected/invalid field in request","code":"invalid_field"}]}