Justin Jones
Justin Jones

Reputation: 81

DocuSign Rest API Polling for Status Updates

I am trying to poll DocuSign every 15 minutes to get envelope status updates. I'm using the listEnvelopes() method described here with some adjustments:

They are setting the lower time constraint like:

// set from date to filter envelopes (ex: Dec 1, 2015)
options.setFromDate("2015/12/01");

Which would get all of the envelopes since 2015/12/01.

However, in my app, I would like to poll every 15 minutes (as per the DocuSign documentation) via Quartz for the window of the last 20 minutes, with a fromDate that will be dynamically calculated based on the current time.

So I have formatted the date (yyyy-MM-dd HH:mm) according to the documentation

However, the only way I can get any envelopes returned is by setting the fromDate property to start of day. (2017-02-17 00:00)

I'm not able to get any results if I add minutes or hours to the date String.( 2017-02-17 20:56) I have updated Docusign's settings for timeZones all to eastern time, as that how my my app is configured. It seems to always ignore the hours and minutes values, but yet the documentation recommends polling every 15 minutes. Am I missing something?

I believe I can get time information from the envelope itself (by fetching using envelopeId). That way I might know what time DocuSign thinks it is.

Upvotes: 1

Views: 488

Answers (1)

Praveen Reddy
Praveen Reddy

Reputation: 7383

Here is the format of the from_date for the listStatusChanges API

options.setFromDate("2017-02-17T20:56:00.000Z")

Your GET request will look like this

GET /v2/accounts/{accountId}/envelopes?from_date=2017-02-17T20:56:00.000Z

Tip: It is much more efficient to use Docusign Webhooks for getting envelope status changes if your Plan supports it.

The status of sent envelopes can be determined through the DocuSign webhook system or by polling. Webhooks are highly recommended: they provide your application with the quickest updates when an envelope’s status changes. In contrast, DocuSign limits polling for an envelope’s status to once every 15 minutes or less frequently.

When a webhook is used, DocuSign calls your application, via the URL you provide, with a notification XML message.

Upvotes: 3

Related Questions