2015-10-19 93 views
0

我們可以使用PHP API發送額外的參數,否則需要由用戶填寫?例如,我們在PDF中有一個字段「地址」。我們已經知道應用程序中的地址,所以我們要預先填寫該地址。這可能嗎?如何將文檔參數發送到Docusign信封

$config = array(
     'integrator_key' => 'asdf', 
     'email' => 'asdf', 
     'password' => 'asdf', 
     // The version of DocuSign API (Ex: v1, v2) 
     'version' => 'v2', 
     // The DocuSign Environment (Ex: demo, test, www) 
     'environment' => 'www', 

    ); 


    $client = new DocuSign_Client($config); 

    echo $current_user->user_email; 

    $role = new DocuSign_TemplateRole('Bulk Recipient', $current_user->user_firstname.' '.$current_user->user_lastname, $current_user->user_email); 
    $roles = array($role); 

    $signatureService = new DocuSign_RequestSignatureService($client); 
    $result = $signatureService->signature->createEnvelopeFromTemplate('asdf', 'asdf', 'sent', $roles); 

更新:

我添加標籤的數據,並在的DocuSign模板中的字段,標記Adres。在發送以下數據到docusign並獲得一個文件簽署沒有添加的數據。猜猜我在這裏仍然在做'錯誤'。

波紋數據數組。

["templateId"]=> 
    string(36) "1e9517bf-51c3-4e40-8bd0-600fe3a35bdf" 
    ["status"]=> 
    string(4) "sent" 
    ["templateRoles"]=> 
    array(1) { 
    [0]=> 
    array(4) { 
     ["roleName"]=> 
     string(14) "Bulk Recipient" 
     ["name"]=> 
     string(15) "Roel Veldhuizen" 
     ["email"]=> 
     string(27) "[email protected]" 
     ["tabs"]=> 
     array(1) { 
     ["textTabs"]=> 
     array(1) { 
      [0]=> 
      array(2) { 
      ["tabLabel"]=> 
      string(5) "Adres" 
      ["value"]=> 
      string(18) "Some example adres" 
      } 
     } 
     } 
    } 
    } 

回答

1

是的。請注意有兩個問題:

  1. 將您的數據提供給DocuSign以供將來在文檔的「選項卡」中使用。

  2. 放置在文檔上希望顯示信息的選項卡上。

最簡單的是,如果您已經知道標籤應該出現在文檔的哪個位置。在這種情況下,請在您的Envelope.Create呼叫中包含選項卡以及數據和位置信息。請參閱請求正文的tabs section。例如,您可以使用text tab for the address line.

您也可以讓人或DocuSign將標籤放在文檔的正確位置,然後使用API​​調用將其填充到數據中。如果感興趣,請查看錨定和模板。

+0

我不完全理解所需的字段,我想我可以預先填寫模板中的字段addid。文檔建議posistions屬性是必需的,因此我將它定製在PDF中?另外,我用當前狀態更新了問題https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Tabs/Text Tab.htm –