INVALID_MULTIPART - Error
Hi,
REST API not working for me in PHP script. ![]()
If i use "Content-Type: application/x-www-form-urlencoded", i got this error below :
{"code":"UNSUPPORTED_MEDIA_TYPE","message":"Content type was not provided or is not supported"}
If i use "Content-Type: multipart/form-data;", i got this error below :
{"code":"INVALID_MULTIPART","message":"An invalid multipart was specified"}
If I use "Content-Type: application/json", i got this :
{"code":"INVALID_JSON","message":"An invalid JSON was specified"}
I don't know what to use more. Can someone tell me if my code is good ? Many thanks !
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.eu1.echosign.com/api/rest/v6/transientDocuments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array('File-Name' => 'CGA.pdf','File'=> new CURLFILE('')),
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"Content-Type: application/json",
),
));
Have a nice day ! ![]()
Laura
