Docusign - EnvelopesAPI query

Viewed 50

We have a developer account and I am starting to integrate it into our system. The system is based on Laravel/VueJS and I've 2 additions Eric Tucker Docusign SDK and the official Docusign SDK.

I want to create quick views on our system for envelopes, so Action Required, Waiting for others, Expiring soon, Completed and Authentication failed. BUT, when I retrieve all the envelopes, I can't see what status the envelope is (for eg: Waiting for others)

Once I've returned all the envelopes, which additonal APIs will return that information?

1 Answers

To retrieve envelope status you'll need to use the listStatusChanges method in the PHP SDK. Here is a small snippet of code I put together based on an example in a controller on our PHP MVC launcher:

$config = new Configuration();
$config->setHost($args['base_path']);
$config->addDefaultHeader('Authorization', 'Bearer ' . $args['ds_access_token']);    
$apiClient = new ApiClient($config);
$envelope_api = new EnvelopesApi($apiClient);

$from_date = date("c", (time() - (10 * 24 * 60 * 60)));
$options = new ListStatusChangesOptions();
$options->setFromDate($from_date);
try {
$results = $envelope_api->listStatusChanges($args['account_id'], $options);
} catch (ApiException $e) {
var_dump($e);
}

This block of code should give you envelope status changes for envelopes in the past 10 days. Be sure to use ISO 8601 date format on the date query parameters.

Related