我一直试图通过调用服务器模板并添加带有值的标签来将数据预填充到模板创建过程中由admin创建的表单字段中
我找到了以下链接:Passing template tabs value while creating envelope Retrieving information from a signed document 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”是我在服务器模板中创建的自定义字段,并从那里拉出,并使用上面的代码我只想为其分配一个值。但是当我访问文档演示站点时,它并没有被填充。
我做错什么了吗?
任何帮助, 谢谢
答案 0 :(得分:1)
我本人一直在进行类似于今天的工作,发现以下解决方案似乎有效。
$textTabArray = array(array('tabLabel' => "regnum", 'value' => "testy"));
$taber = array("textTabs" => $textTabArray);
//for me tabs were in a different method
'tabs' => $taber
我使用了一种稍有不同的方法,该方法使用了PHP OAuth和签名,网址为:
https://github.com/docusign/eg-03-php-auth-code-grant/blob/master/src/EG009UseTemplate.php
将标签添加到签名者和模板角色模型。
希望有帮助!