2015-12-24 76 views
0



我有一個關於docusign api的問題。我正在使用docusign api進行電子簽名。在我的要求中,收件人視圖不會顯示在docusign網站上,只會顯示在我的網站上,用戶可以在該網站上爲文檔執行電子簽名。基本上我做到了。我的問題現在開始。我如何在文檔上添加兩個收件人。我嘗試使用單個收件人,但不知道如何使用多個收件人。在這裏兩個收件人(人)一個是我,另一個是我的客戶從我那裏購買產品。當我把這個信封發送給我的客戶。它會先到我身後,然後我的牌子會到我的客戶端並等待它的標誌。我怎樣才能做到這一點呢?如何將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", "[email protected]", $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", 
         "[email protected]", 
         $signed_document_id, 
         $authMethod); 

$sign_url = $response->url; 
+1

你的問題不清楚。你想通過你的應用程序首先簽署你的信封嗎?那麼你希望你的客戶通過你的應用程序進行簽名?你的優先次序是什麼意思?請編輯您的問題,使其更清楚。 –

+0

@Larry是的,我想先通過應用程序在我的信封上簽名,然後我想簽署我的客戶可以在該信封上簽名。 –

回答

2

是的,您可以讓兩個不同的人通過DocuSign簽署文檔,其中兩個簽名都在您的應用程序中籤名。

這被稱爲「嵌入式簽名」。

  1. 與兩個簽署者創建信封(簽名請求)。您必須爲兩個收件人提供clientUserId字段。
  2. 信封創建的結果是一個envelope_id。將其與getRecipientView方法一起使用以獲取第一個簽名者的url。
  3. 將簽名者重定向到要簽名的網址。簽名後,簽名者的瀏覽器將重新導回到您的應用程序。您可以使用iframe,但如果有人有機會通過手機/平板電腦進行簽名,則不推薦使用iframe。
  4. 稍後,另一個簽名者將登錄到您的應用程序。那時,您可以重複之前的步驟來啓用第二個簽名者簽名。

請記住,當您允許某人在您的應用程序中籤名時,您的應用程序負責對簽名者進行身份驗證。請參閱recipe for embedded signing

+0

感謝您的回答。 –

相關問題