简体   繁体   English

在日期之间完成Docusign获取信封

[英]Docusign Get Envelopes Completed Between Dates

I need to get IDs of all envelopes that were completed between 1/1/2014 and 12/31/2014. 我需要获取2014年1月1日至2014年12月31日之间完成的所有信封的ID。 Is this possible? 这可能吗?

You can use the Envelope Publish feature on the the DocuSign Console. 您可以在DocuSign控制台上使用信封发布功能。
Preferences -> Envelope Publish (under Account Administration) In your case set the search criteria for From to be 01/01/2014 - 12/31/2014 and Envelope Status to Completed . 首选项->信封发布(在“帐户管理”下)根据您的情况,将“ 从”的搜索条件设置为2014 年1月1日至2014 年12月31日 ,将“ 信封状态”设置已完成 Once you have your results you can use the "Save data as .CSV file" button to get it in a more consumable format. 获得结果后,可以使用“将数据另存为.CSV文件”按钮以更易使用的格式进行获取。

There are multiple ways of accomplishing this. 有多种方法可以实现此目的。 Reinkesm's post is one way that an end-user can get a set of envelopes that changed to a certain status within a given timeframe. Reinkesm的帖子是最终用户获得一组在给定时间内更改为特定状态的信封的一种方式。 Another way is to use the DocuSign Retrieve module, though this is once again intended for an end-user. 另一种方法是使用DocuSign Retrieve模块,尽管这再次是针对最终用户的。

If you are looking to accomplish this programmatically through an API call there is an existing call that makes this easy. 如果您希望通过API调用以编程方式完成此任务,则可以通过现有调用轻松实现。 You can filter the envelopes by date and or changed status. 您可以按日期和/或更改的状态过滤信封。

Have you see the DocuSign API Walkthroughs ? 您是否看到了DocuSign API演练 The 5th walkthrough shows how to retrieve by making a GET call to the /envelopes URI. 第5个演练展示了如何通过对/envelopes URI进行GET调用来进行检索。 I'm not sure which language you are using so check out the walkthrough and you'll see 6 different language samples including PHP , Node.js , C# , Java , Python , and Objective-C : 我不确定您使用的是哪种语言,因此请查看演练,您将看到6种不同的语言示例,包括PHPNode.jsC#JavaPythonObjective-C

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

For instance, here is the PHP code sample: 例如,这是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";
    }    
?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM