Hello thanks for getting back so soon.
function CreateTicketTaskHours($space,$description,$hours,$user_id,$end_at,$begin_at) {
//Make the ticket here, later make attachment
$headers = array('X-Api-Key: e1', 'X-Api-Secret: d964', 'Content-type: application/json');
$post_curl = "{\"user_task\":{\"space_id\":\"" . $space . "\",\"description\":\"" . $description . "\",\"user_id\":\"" . $user_id . "\",\"begin_at\":\"" . $begin_at . "\",\"hours\":\"" . $hours . "\",\"end_at\":\"" . $end_at . "\"}}";
$curl_channel = curl_init();
//echo($curl_channel);
curl_setopt_array($curl_channel, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $post_curl,
CURLOPT_SSL_VERIFYPEER => false
));
$response = curl_exec($curl_channel);
$http_status = curl_getinfo($curl_channel, CURLINFO_HTTP_CODE);
print("HTTP status: " . $http_status);
}
I keep getting a 422 error message and I can't seem to figure out what is wrong.
Any help would be appreciated.