您是否可以在应用程序中嵌入DocuSign签名而无需生成模板?

时间:2018-02-21 20:04:36

标签: php rest docusignapi

我使用了DocuSign API,并且能够在不首先创建模板的情况下将信封发送给签名者。

创建Document对象,然后将其附加到请求:

$document    = new Document();
$document->setDocumentId($this->contractId);
$document->setDocumentBase64($this->getContractData());
$document->setFileExtension($this->getContractFileExtension());
$document->setName($this->contract->name);

$signHere    = new SignHere();
$signHere->setAnchorString('{{SIGNATURE}}');
$signHere->setRecipientId($this->userId);
$signHere->setName('Please sign here');
$signHere->setOptional(false);
$signHere->setScaleValue(1);
$signHere->setTabLabel('signer1sig');



$tabs        = new Tabs();
$tabs->setSignHereTabs([$signHere]);

$signer      = new Signer();
$signer->setEmail($this->user->email);
$signer->setName($this->user->profile->first_name . ' ' . $this->user->profile->last_name);
$signer->setRecipientId($this->userId);
$signer->setTabs($tabs);

$recipients  = new Recipients();
$recipients->setSigners([$signer]);

$definition  = new EnvelopeDefinition();
$definition->setDocuments([$document]);
$definition->setEmailSubject('Your test contract - Signature Requested');
$definition->setStatus('sent');
$definition->setRecipients($recipients);



$options = new EnvelopesApi\CreateEnvelopeOptions();
$options->setCdseMode(null);
$options->setMergeRolesOnDraft(null);

$envelope = $envelopeApi->createEnvelope($accountId, $definition, $options);

但是,我们希望提供电子邮件签名和嵌入式签名的选项。我的问题是 - 是否可以在我们的应用程序中嵌入签名实例而无需生成模板?

1 个答案:

答案 0 :(得分:2)

如果要为不同的签名者反复重复使用同一文档,则需要DocuSign服务器模板。当您想要托管嵌入式签名时,诀窍是在Signer详细信息中添加clientUserId。在Signer中设置clientUserId会通知DocuSign该签名者将信封签署为embedded signer,并且它与DS服务器模板无关。您可以看到嵌入式签名示例here和配方也可用here。现在,如果要向签名者提供嵌入式和远程签名选项,则需要创建两个具有相同名称和电子邮件的签名者。如果签名者完成嵌入式签名(使用DS Connect订阅此事件),则使用API​​ go并删除远程签名者,反之亦然。

相关问题