问题描述
目标是在创建信封/草稿信封时附加pdf /其他文件。我正在使用PHP5 Docusign。
请在此随附“ create_proposal.PHP”作为“ create_proposal.txt”以供参考。
// instantiate a new envelope attachment
$content_bytes = file_get_contents("test.pdf");
$doc1_b64 = base64_encode($content_bytes);
$document1 = new \DocuSign\eSign\Model\Document([ # create the DocuSign document object
'document_base64' => $doc1_b64,'name' => 'Order ackNowledgement',# can be different from actual file name
'file_extension' => 'pdf',# many different document types are accepted
'document_id' => '1' # a label used to reference the doc
]);
$envelop_deFinition->setDocuments([$document1]);
响应为:
<pre>DocuSign\eSign\Client\ApiException Object
(
[responseBody:protected] => O:8:"stdClass":2:{s:9:"errorCode";s:33:"TAB_PAGENUMBER_IS_NOT_IN_DOCUMENT";s:7:"message";s:134:"The pagenumber specified in the tab element is not in the document that the tab refers to. Tab on Page 4 of Document 1 for Recipient 1";}
[responseHeaders:protected] => Array
(
[0] => HTTP/1.1 400 Bad Request
[Cache-Control] => no-cache
[Content-Length] => 196
[Content-Type] => application/json; charset=utf-8
[X-RateLimit-Reset] => 1604228400
[X-RateLimit-Remaining] => 992
[X-RateLimit-Limit] => 1000
[X-BurstLimit-Remaining] => 499
[X-BurstLimit-Limit] => 500
[X-DocuSign-Tracetoken] => 943befbf-c776-4d03-a091-be5202acede7
[X-DocuSign-Node] => DA4FE36
[Date] => Sun,01 Nov 2020 10:10:54 GMT
[vary] => Accept-Encoding
)
请提供解决方案。谢谢。