Upload a new document through multipart/form-data using Postman
Thursday, May 5, 2016 at 05:54amHello!
I seem to be getting a 500 when I try to upload a new document. I am not exactly sure what is going wrong;
I attached my settings below, and this is the generated HTTP snippet by Postman
POST /api/packages/cRtQjTTkipxb6m3LiHkaLEeEcDo=/documents HTTP/1.1 Host: sandbox.esignlive.com Authorization: Basic MY_API_KEY Accept: text/html Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ----WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="files[]"; filename="" Content-Type: ----WebKitFormBoundary7MA4YWxkTrZu0gW
Reply to: Upload a new document through multipart/form-data using Postman
Thursday, May 5, 2016 at 06:21amReply to: Upload a new document through multipart/form-data using Postman
Thursday, May 5, 2016 at 06:28amReply to: Upload a new document through multipart/form-data using Postman
Thursday, May 5, 2016 at 06:36amReply to: Upload a new document through multipart/form-data using Postman
Friday, May 6, 2016 at 07:44am'@' . $file_name_with_full_path); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $target_url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Authorization: Basic MY_API_KEY", "Accept: text/html", "content-type: multipart/form-data;" )); $result = curl_exec($ch); curl_close($ch);?>Reply to: Upload a new document through multipart/form-data using Postman
Friday, May 6, 2016 at 08:12amReply to: Upload a new document through multipart/form-data using Postman
Friday, May 6, 2016 at 10:21am$documentJSON, "file"=>"@$documentPath" ); $headerOptions = array( 'Authorization: Basic ' . $ESIGNLIVE_AUTH_KEY ); if(!is_null($contentType)) { $headerOptions[] = "Content-Type: $contentType"; } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); if(!is_null($postfields)) { curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); if(!is_array($postfields)) { $headerOptions[] = 'Content-Length: ' . strlen($postfields); } } curl_setopt($ch, CURLOPT_HTTPHEADER, $headerOptions); $response = curl_exec($ch); curl_close($ch); echo $response; ?>And here is the JSON I used for the payload:{ "id": "document1", "name": "Sample NDA" }Let me know if this works for you.Reply to: Upload a new document through multipart/form-data using Postman
Friday, May 6, 2016 at 10:55amReply to: Upload a new document through multipart/form-data using Postman
Friday, May 6, 2016 at 03:03pm$document = file_get_contents("project-info\document.pdf"); $postfields = array( "payload"=> $documentJSON, "file"=> $document );Let me know if it works for you.Reply to: Upload a new document through multipart/form-data using Postman
Friday, May 6, 2016 at 05:29pm$documentJSON, "file"=> $document ); $headerOptions = array( 'Authorization: Basic ' . $ESIGNLIVE_AUTH_KEY ); if(!is_null($contentType)) { $headerOptions[] = "Content-Type: $contentType"; } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); if(!is_null($postfields)) { curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); if(!is_array($postfields)) { $headerOptions[] = 'Content-Length: ' . strlen($postfields); } } curl_setopt($ch, CURLOPT_HTTPHEADER, $headerOptions); $response = curl_exec($ch); curl_close($ch); echo $response; ?>Reply to: Upload a new document through multipart/form-data using Postman
Sunday, May 8, 2016 at 12:32pmReply to: Upload a new document through multipart/form-data using Postman
Wednesday, October 19, 2016 at 06:17pmReply to: Upload a new document through multipart/form-data using Postman
Thursday, October 20, 2016 at 03:42am