我一直在尝试通过调用服务器模板并添加带有值的选项卡来将数据预填充到管理员在模板创建期间创建的表单字段中
我找到了这个链接:在创建信封时传递模板选项卡值 从签名文档中检索信息 DocuSign API
但这并没有多大帮助,因为我正在尝试如下所示的 php 代码:
$signer1 = new \DocuSign\eSign\Model\Signer([
'email' => $signer_email, 'name' => $signer_name,
'role_name' => "signer", 'recipient_id' => "1",
'client_user_id' => $clientUserId,
'defaultrecipient'=> "true",
'tabs' => new \DocuSign\eSign\Model\Tabs( [
'textTabs' => new \DocuSign\eSign\Model\Text ([
'tabLabel' => "dob",
'value'=> "12/3/1998"
])
])
]);
$recipients_server_template = new \DocuSign\eSign\Model\Recipients([
'signers' => [$signer1]]);
$comp_template1 = new \DocuSign\eSign\Model\CompositeTemplate([
'composite_template_id' => "1",
'server_templates' => [
new \DocuSign\eSign\Model\ServerTemplate([
'sequence' => "1", 'template_id' => '6ef9c9c2-2f15-4a80-9643-f3c5a310dcdc'])
],
'inline_templates' => [
new \DocuSign\eSign\Model\InlineTemplate([
'sequence' => "1",
'recipients' => $recipients_server_template])
],
]);
$envelopeDefinition = new \DocuSign\eSign\Model\EnvelopeDefinition([
'email_subject' => "Please sign this document",
//'documents' => [$comp_template1], # The order in the docs array determines the order in the envelope
'composite_templates' => [$comp_template1],
/*'recipients' => new DocuSign\eSign\Model\Recipients(['signers' => [$signer]]), */
'status' => "sent"
]);
正如您在上面看到的,“dob”是我在服务器模板中创建的自定义字段,并从那里提取并使用上面的代码我只想为其分配一个值。但是当我访问文档演示站点时,它并没有被填充。
我做错什么了吗??
非常感谢任何帮助,谢谢