Retrieving envelope expiry details from DocuSign API

I’m trying to get the expiration info for envelopes I create using DocuSign’s REST API. I can set custom expiration dates when making envelopes, but I’m struggling to verify these dates in my integration tests.

The API docs say I should be able to get this info by sending a GET request to /accounts/{accountId}/envelopes/{envelopeId}. But when I do this, I only get some of the fields mentioned in the example response.

Here’s what I get back:

{
  "status": "sent",
  "envelopeId": "123-ABC-XYZ",
  "createdDateTime": "2023-05-01T10:30:00Z",
  "sentDateTime": "2023-05-01T10:31:00Z",
  "lastModifiedDateTime": "2023-05-01T10:31:00Z",
  "purgeState": "unpurged"
}

I’m really after the notification field and its subfields, which should have the expiration info. But they’re not in the response.

Is this a problem with DocuSign or am I doing something wrong? Any ideas on how to get the envelope expiration details?

hey there! i’ve run into this before. make sure you’re using the right API version - some older ones don’t include all the fields. also, try adding ?include=notification to your request URL. that should force it to return the expiration stuff you need. if that doesn’t work, double check your account permissions. good luck!

I’ve dealt with similar issues when working with DocuSign’s API. From my experience, the problem might be related to the scope of information you’re requesting. By default, the API doesn’t return all available fields to optimize response times and data transfer.

Try adding a ‘query’ parameter to your GET request with ‘advanced=true’. This should give you more detailed envelope information, including the notification settings. Your request URL would look something like this:

/accounts/{accountId}/envelopes/{envelopeId}?advanced=true

If that doesn’t work, you might need to check your API permissions. Ensure your integration has the necessary scopes to access notification details. Sometimes, these permissions are not included by default and need to be explicitly requested.

Lastly, if you’re still not seeing the expiration info, it’s possible that no custom expiration was set for that particular envelope. In that case, DocuSign might not include the field in the response. You may want to double-check that you’re actually setting the expiration when creating the envelope in your test cases.

Having worked extensively with DocuSign’s API, I can offer some insight. The issue you’re facing is likely due to the default response not including all available fields. To retrieve the notification details, including expiration info, you need to modify your request slightly.

Try appending ‘?include=recipients,tabs,custom_fields,notification,documents’ to your GET request URL. This explicitly tells the API to include the notification object in the response. Your new request should look like:

/accounts/{accountId}/envelopes/{envelopeId}?include=recipients,tabs,custom_fields,notification,documents

If this doesn’t resolve the issue, double-check your API permissions to ensure you have the necessary access levels. Also, verify that you’re actually setting custom expiration dates when creating envelopes in your integration tests. Sometimes, the absence of these fields in the response indicates they weren’t set in the first place.