I have tried to use this code to upload a file using curl / php and I get a HTTP 422 error.
Not sure where the error could be.
$headers = array('X-Api-Key: e14cf5','X-Api-Secret: 5b6aac6df0d639c14b7b555d','Content-Type multipart/form-data');
$p = '@' . realpath('C:/Users/ci1gsx/Downloads/AcYear.pdf ');
$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);;
Any help would be appreciated.