I have a concern regarding DocuSign, that i can't manage to resolve, Hope that someone could give me a hint or spot what I'm missing.
Currently in the application , a user can select a document to sign, so when i try to implement the signing part with DocuSign i got this error "404 : "NO_DOCUMENT_RECEIVED": "The document element did not contain the encoded document, 'documentId='possibly missing from Content-Disposition header." ".
here a bunch of code that i'm working on it for the moment i have implemented two kind of solution, one is working and the other one not :
Not working : $args["doccontent"] is the way i call the document from database(its a pdf).
$doc_internal_name = str_replace("http://127.0.0.1:8000/","C:/laragon2/www/ApplicationNAme/public/",$args['doccontent']);
$doc_content = file_get_contents($doc_internal_name );
$base64FileContent = base64_encode($doc_content);
$document = new Document(
[
'document_base64' => $base64FileContent,
'name' => 'testdoc',
'file_extension' => "pdf",
'document_id' => 1
]
);
/* Create the signer recipient model */
$signer = new \DocuSign\eSign\Model\Signer([
'email' => email,
'name' => name ,
'recipient_id' => '1',
'routing_order' => '1',
'client_user_id' => $args['signer_client_id']
]);
/* Create a signHere tab (field on the document) */
$signHere = new \DocuSign\eSign\Model\SignHere([
'anchor_string' => '/sn1/',
'anchor_units' => 'pixels',
'anchor_y_offset' => '10',
'anchor_x_offset' => '20'
]);
/* Create a signHere 2 tab (field on the document) */
$signHere2 = new \DocuSign\eSign\Model\SignHere([
'anchor_string' => '/sn2/',
'anchor_units' => 'pixels',
'anchor_y_offset' => '40',
'anchor_x_offset' => '40'
]);
$signer->settabs(new \DocuSign\eSign\Model\Tabs(['sign_here_tabs' => [$signHere, $signHere2]]));
$envelopeDefinition = new \DocuSign\eSign\Model\EnvelopeDefinition([
'email_subject' => "Please sign this document",
'documents' => [$document],
'recipients' => new \DocuSign\eSign\Model\Recipients(['signers' => [$signer]]),
]);
return $envelopeDefinition;
Working : when i specify directly the same path of the same document in the solution that is not working :
$content = file_get_contents("../public/uploads/zbD0nVz3NoEYjg2ttHnrhoJ7JM7OQbqSVQCnNT8U.pdf");
$base64FileContent = base64_encode($content);
$document = new Document(
[
'document_base64' => $base64FileContent,
'name' => 'test',
'file_extension' => 'pdf',
'document_id' => 1
]
);
/* Create the signer recipient model */
$signer = new \DocuSign\eSign\Model\Signer([
'email' => email,
'name' => name ,
'recipient_id' => '1',
'routing_order' => '1',
'client_user_id' => $args['signer_client_id']
]);
/* Create a signHere tab (field on the document) */
$signHere = new \DocuSign\eSign\Model\SignHere([
'anchor_string' => '/sn1/',
'anchor_units' => 'pixels',
'anchor_y_offset' => '10',
'anchor_x_offset' => '20'
]);
/* Create a signHere 2 tab (field on the document) */
$signHere2 = new \DocuSign\eSign\Model\SignHere([
'anchor_string' => '/sn2/',
'anchor_units' => 'pixels',
'anchor_y_offset' => '40',
'anchor_x_offset' => '40'
]);
$signer->settabs(new \DocuSign\eSign\Model\Tabs(['sign_here_tabs' => [$signHere, $signHere2]]));
$envelopeDefinition = new \DocuSign\eSign\Model\EnvelopeDefinition([
'email_subject' => "Please sign this document",
'documents' => [$document],
'recipients' => new \DocuSign\eSign\Model\Recipients(['signers' => [$signer]]),
]);
return $envelopeDefinition;
but i want the first one to work, cause different users will use the application and they will be signing different document
thank you so much for your help.