1

I need to get IDs of all envelopes that were completed between 1/1/2014 and 12/31/2014. Is this possible?

Trying...
  • 127
  • 9

2 Answers2

2

You can use the Envelope Publish feature on the the DocuSign Console.
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. Once you have your results you can use the "Save data as .CSV file" button to get it in a more consumable format.

reinkesm
  • 511
  • 2
  • 6
2

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. Another way is to use the DocuSign Retrieve module, though this is once again intended for an end-user.

If you are looking to accomplish this programmatically through an API call there is an existing call that makes this easy. You can filter the envelopes by date and or changed status.

Have you see the DocuSign API Walkthroughs? The 5th walkthrough shows how to retrieve by making a GET call to the /envelopes URI. 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:

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

For instance, here is the PHP code sample:

<?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";
    }    
?>
Ergin
  • 9,254
  • 1
  • 19
  • 28