2014-12-01 58 views

回答

2

實現此目的有多種方法。 Reinkesm的文章是最終用戶可以獲得一組在指定時間範圍內變爲某種特定狀態的信封的一種方式。另一種方法是使用DocuSign Retrieve模塊,儘管這又是針對最終用戶的。

如果你正在尋找通過API調用有一個現有的呼叫,使得這個簡單的編程方式實現這一目標。您可以按日期和/或更改狀態過濾信封。

你是否看到DocuSign API Walkthroughs?第5個演練通過調用/envelopes URI來調用GET來演示如何檢索。我不知道你使用所以檢查出的演練的語言,你會看到6個不同的語言樣本包括PHPNode.jsC#JavaPythonObjective-C

http://iodocs.docusign.com/APIWalkthrough/getEnvelopeStatus

例如,這裏是PHP代碼示例:

<?php 

    // Input your info here: 
    $email = "***";   // your account email 
    $password = "***";  // your account password 
    $integratorKey = "***";  // your account integrator key, found on (Preferences -> API page) 

    // construct the authentication header: 
    $header = "<DocuSignCredentials><Username>" . $email . "</Username><Password>" . $password . "</Password><IntegratorKey>" . $integratorKey . "</IntegratorKey></DocuSignCredentials>"; 

    ///////////////////////////////////////////////////////////////////////////////////////////////// 
    // STEP 1 - Login (retrieves baseUrl and accountId) 
    ///////////////////////////////////////////////////////////////////////////////////////////////// 
    $url = "https://demo.docusign.net/restapi/v2/login_information"; 
    $curl = curl_init($url); 
    curl_setopt($curl, CURLOPT_HEADER, false); 
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($curl, CURLOPT_HTTPHEADER, array("X-DocuSign-Authentication: $header")); 

    $json_response = curl_exec($curl); 
    $status = curl_getinfo($curl, CURLINFO_HTTP_CODE); 

    if ($status != 200) { 
     echo "error calling webservice, status is:" . $status; 
     exit(-1); 
    } 

    $response = json_decode($json_response, true); 
    $accountId = $response["loginAccounts"][0]["accountId"]; 
    $baseUrl = $response["loginAccounts"][0]["baseUrl"]; 
    curl_close($curl);  

    //--- display results 
    echo "\naccountId = " . $accountId . "\nbaseUrl = " . $baseUrl . "\n"; 

    ///////////////////////////////////////////////////////////////////////////////////////////////// 
    // STEP 2 - status retrieval using filters 
    ///////////////////////////////////////////////////////////////////////////////////////////////// 
    echo "Performing status retrieval using filters...\n"; 
    date_default_timezone_set('America/Los_Angeles'); 
    $from_date = date("m") . "%2F" . (date("d")-7) . "%2F". date("Y"); 

    $curl = curl_init($baseUrl . "/envelopes?from_date=$from_date&status=created,sent,delivered,signed,completed"); 
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(                   
     'Accept: application/json', 
     "X-DocuSign-Authentication: $header")                  
    ); 

    $json_response = curl_exec($curl); 
    $status = curl_getinfo($curl, CURLINFO_HTTP_CODE); 
    if ($status != 200) { 
     echo "error calling webservice, status is:" . $status . "\nerror text is --> "; 
     print_r($json_response); echo "\n"; 
     exit(-1); 
    } 

    $response = json_decode($json_response, true); 

    //--- display results 
    echo "Received " . count($response["envelopes"]) . " envelopes\n"; 
    foreach ($response["envelopes"] as $envelope) { 
     echo "envelope: " . $envelope["envelopeId"] . " " . $envelope["status"] . " " . $envelope["statusChangedDateTime"] . "\n"; 
    }  
?> 
2

您可以使用DocuSign控制檯上的Envelope Publish功能。
首選項 - >信封發佈(在帳戶管理) 在你的情況設置搜索條件爲2014年1月1日 - 2014年12月31日信封狀態完成。獲得結果後,您可以使用「將數據另存爲.CSV文件」按鈕,以使其更易於使用。