如何将 docusign 信封发送给多个收件人?

How can i send docusign envelop to multiple recipient?



我有一个关于 docusign api 的问题。我正在使用 docusign api 进行电子签名。根据我的要求,收件人视图不会显示在 docusign 网站上,只会显示在我的网站上,用户可以在该网站上对文档进行电子签名。基本上我做到了这一点。我的问题现在开始。如何在文档上添加两个收件人。我尝试使用单个收件人,但不知道如何使用多个收件人。这里有两个收件人(人),一个是我,另一个是我的客户,他们从我这里购买产品。当我把这个信封寄给我的客户时。它会先到我这里,然后在我的签名之后会转到我的客户端并等待它的签名。我该怎样做呢?

require_once './docusign-php-client/src/DocuSign_Client.php';
require_once './docusign-php-client/src/service/DocuSign_RequestSignatureService.php';
require_once './docusign-php-client/src/service/DocuSign_ViewsService.php';

$clientConfig = array(
        // Enter your Integrator Key, Email, and Password
        'integrator_key' => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 'email' => "xxxxxxxxxxxxxxxxxxxxxx", 'password' => "xxxxxxxxxxxxxxxxxx",
        // API version (v2 is latest) and environment (i.e. demo, www, etc)
        'version' => 'v2', 'environment' => 'demo'
);

// Instantiate client and call the Login API
$client = new DocuSign_Client($clientConfig);

// create service object and configure envelope settings, document(s), and recipient(s)
$service = new DocuSign_RequestSignatureService($client);

$emailSubject = "Please sign this document.";
$emailBlurb = "This is a document from Developer who test this docusign app. I would like to work with this.";

// add one signHere tab for the recipient located 100 pixels right and
// 150 pixels down from the top left corner of document's first page
$tabs1 = array( "signHereTabs" => array( 
                array( "documentId" => "2",
                    "pageNumber" => "1",
                    "xPosition" => "450",
                    "yPosition" => "233" )));

// $tabs2 = array( "signHereTabs" => array( 
//              array( "documentId" => "2",
//                  "pageNumber" => "1",
//                  "xPosition" => "130",
//                  "yPosition" => "233" )));


$signed_document_id = time();

// add a recipient and document to the envelope
$recipients = array( new DocuSign_Recipient( "1", "1", "I am", "my-email@my-email.in", $signed_document_id, 'signers', $tabs1) );
$documents = array( new DocuSign_Document("TEST.PDF", "1", file_get_contents("BCD.pdf")) , new DocuSign_Document("TEST.PDF", "2", file_get_contents("ABC.pdf")) );

// "sent" to send immediately, "created" to save as draft in your account   
$status = 'sent';

//*** Create and send the envelope with embedded recipient
$response = $service->signature->createEnvelopeFromDocument( $emailSubject, $emailBlurb, $status, $documents, $recipients, array() );

/**************************************************/
/*      Step- 3 Embadded sign iframe              */
/**************************************************/

$service = new DocuSign_ViewsService($client);

$envelopeId = $response->envelopeId;
$returnUrl = "https://demo.docusign.com;
$authMethod = "email";

$response = $service->views->getRecipientView(  $returnUrl,
                        $envelopeId, 
                        "i am", 
                        "my-email@my-email.in",
                        $signed_document_id,
                        $authMethod );

$sign_url = $response->url;

是的,您可以让两个不同的人通过 DocuSign 签署文档,他们都在您的应用程序中签名。

这叫做"embedded signing."

  1. 创建包含两位签名者的信封(签名请求)。您必须为两个收件人提供 clientUserId 字段。
  2. 信封创建的结果是 envelope_id。将它与 getRecipientView 方法一起使用以获得第一个签名者的 url。
  3. 将签名者重定向到 url 进行签名。签名后,签名者的浏览器 re-directed 返回您的应用程序。您可以使用 iframe,但如果人们有可能通过 mobile/tablet 设备签名,则不推荐使用。
  4. 稍后,其他签名者将登录到您的应用程序。届时,您可以重复前面的步骤让第二个签名者签名。

请记住,当您允许某人从您的应用程序中签名时,您的应用程序负责对签名者进行身份验证。

更多信息:参见 recipe for embedded signing