I'm sorry about that I should have read that.
The Curl statement now works, but I'm wanting it to upload via php. Below is my code:
$headers = array('X-Api-Key: e14cf558e8d7','X-Api-Secret: 5b6aac6df0d639c14c46ddc','document[file]=@c:/Users/ci1gsx/Downloads/AcYear.pdf','Content-type: application/json','Content-Type multipart/form-data');
$p = "{\"ticket\":{\"summary\":\"".$create."\",\"custom_fields\":{\"Points\":\"".$points."\",\"CurrOwner\":\"".$owner."\",\"Project\":\"".$project."\"}}}"; (this line works used for ticket creation)
$ch = curl_init();
echo($ch);
curl_setopt_array($ch, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $p,
CURLOPT_SSL_VERIFYPEER => false
));
$response = curl_exec($ch);
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
print("HTTP status: " . $http_status);
I get a HTTP 422 error. I know the above code works because I've used it to create tickets but not sure what I need to alter to upload files with it.