Docusign REST API描述了一种在从文档创建封套时控制文档可见性的方法:
https://docs.docusign.com/esign/restapi/Envelopes/Envelopes/create/
选项为enforceSignerVisibility
。但是,当我尝试使用此选项时,可见性不受限制。我做错了吗?
我正在使用PHP DocuSign帮助程序库的修改版本(添加了一些功能/选项)。
这是我创建的测试用例。在这种情况下,有两个签名者和两个文件。签名者1在文档1上有签名,签名者2在文档2上有签名。目标是签名者1只能看到文档1,签名者2只能看到文档2.但是,下面的例子导致两个签名者都看到两个文件:
代码
<?php
$client = new DocuSign_Client;
$service = new DocuSign_RequestSignatureService($client);
$documents = array(
new DocuSign_Document(
"TestDoc1",
1,
file_get_contents( $_SERVER['DOCUMENT_ROOT'].'/sandbox/ncg/test1.pdf' )
),
new DocuSign_Document(
"TestDoc2",
2,
file_get_contents( $_SERVER['DOCUMENT_ROOT'].'/sandbox/ncg/test2.pdf' )
)
);
$signer1 = new DocuSign_Recipient(
1,
1,
"Signer 1",
"test.tfcornerstone+t1@gmail.com",
NULL
);
$signer1->setTab("signHereTabs",array(
"anchorYOffset" => "0",
"anchorXOffset" => "0",
"anchorString" => "[__[Signer1]__]",
"anchorIgnoreIfNotPresent" => true,
) );
$signer2 = new DocuSign_Recipient(
1,
2,
"Signer 2",
"test.tfcornerstone+t2@gmail.com",
NULL
);
$signer2->setTab("signHereTabs",array(
"anchorYOffset" => "0",
"anchorXOffset" => "0",
"anchorString" => "[__[Signer2]__]",
"anchorIgnoreIfNotPresent" => true,
) );
$recipients = array( $signer1, $signer2 );
$emailSubject = "Test Doc";
$emailBlurb = "Testing Visibility";
$status = 'sent'; // can be "created" or "sent"
$eventNotifications = new DocuSign_EventNotification(
$url, //url
false, //loggingEnabled
false, //requireAcknowledgment,
false, //useSoapInterface,
NULL, //soapNameSpace,
false, //includeCertificateWithSoap,
false, //signMessageWithX509Cert,
false, //includeDocuments,
false, //includeTimeZone,
false, //includeSenderAccountAsCustomField,
NULL, //envelopeEvents,
array( "Completed", "Sent" ) //recipientEvents
);
$options = array(
"enforceSignerVisibility" => true,
);
$response = $service->signature->createEnvelopeFromDocument(
$emailSubject,
$emailBlurb,
$status,
$documents,
$recipients,
$eventNotifications,
$options
);
d($response);
CURL请求
网址:https://www.docusign.net/restapi/v2/accounts/XXXXX/envelopes
方法:POST
接头:
--myboundary
Content-Type: application/json
Content-Disposition: form-data
{"emailSubject":"Test Doc","emailBlurb":"Testing Visibility","documents":[{"name":"TestDoc1","documentId":1},{"name":"TestDoc2","documentId":2}],"status":"sent","enforceSignerVisibility":true,"recipients":{"signers":[{"routingOrder":1,"recipientId":1,"name":"Signer 1","email":"test.tfcornerstone+t1@gmail.com","clientUserId":null,"tabs":{"signHereTabs":[{"anchorYOffset":"0","anchorXOffset":"0","anchorString":"[__[Signer1]__]","anchorIgnoreIfNotPresent":true}]},"embeddedRecipientStartUrl":null,"excludedDocuments":null},{"routingOrder":1,"recipientId":2,"name":"Signer 2","email":"test.tfcornerstone+t2@gmail.com","clientUserId":null,"tabs":{"signHereTabs":[{"anchorYOffset":"0","anchorXOffset":"0","anchorString":"[__[Signer2]__]","anchorIgnoreIfNotPresent":true}]},"embeddedRecipientStartUrl":null,"excludedDocuments":null}]},"eventNotification":{"loggingEnabled":false,"requireAcknowledgment":false,"useSoapInterface":false,"includeCertificateWithSoap":false,"signMessageWithX509Cert":false,"includeDocuments":false,"includeTimeZone":false,"includeSenderAccountAsCustomField":false,"recipientEvents":[{"recipientEventStatusCode":"Completed"},{"recipientEventStatusCode":"Sent"}]}}
<<PDF CONTENT>>--myboundary--
格式化的JSON数据
{
"emailSubject": "Test Doc",
"emailBlurb": "Testing Visibility",
"documents": [
{
"name": "TestDoc1",
"documentId": 1
},
{
"name": "TestDoc2",
"documentId": 2
}
],
"status": "sent",
"enforceSignerVisibility": true,
"recipients": {
"signers": [
{
"routingOrder": 1,
"recipientId": 1,
"name": "Signer 1",
"email": "test.tfcornerstone+t1@gmail.com",
"clientUserId": null,
"tabs": {
"signHereTabs": [
{
"anchorYOffset": "0",
"anchorXOffset": "0",
"anchorString": "[__[Signer1]__]",
"anchorIgnoreIfNotPresent": true
}
]
},
"embeddedRecipientStartUrl": null,
"excludedDocuments": null
},
{
"routingOrder": 1,
"recipientId": 2,
"name": "Signer 2",
"email": "test.tfcornerstone+t2@gmail.com",
"clientUserId": null,
"tabs": {
"signHereTabs": [
{
"anchorYOffset": "0",
"anchorXOffset": "0",
"anchorString": "[__[Signer2]__]",
"anchorIgnoreIfNotPresent": true
}
]
},
"embeddedRecipientStartUrl": null,
"excludedDocuments": null
}
]
},
"eventNotification": {
"loggingEnabled": false,
"requireAcknowledgment": false,
"useSoapInterface": false,
"includeCertificateWithSoap": false,
"signMessageWithX509Cert": false,
"includeDocuments": false,
"includeTimeZone": false,
"includeSenderAccountAsCustomField": false,
"recipientEvents": [
{
"recipientEventStatusCode": "Completed"
},
{
"recipientEventStatusCode": "Sent"
}
]
}
}
答案 0 :(得分:2)
我不相信DocVis可以设置为“关闭”以便在API中强制执行。在首选项 - &gt;功能将DocVis下拉菜单更改为“发件人可以设置必须签名以查看除非发件人帐户”并再次提供相同的请求。