I have a list of envelopes that works fine with liststatuschanges, but I would like to exclude the envelopes that belong to batch (which are currently also appearing in the list of envelopes), to make a separate list for batch only. Is there any way to exclude those envelopes that were sent within a batch from my envelope list?
Asked
Active
Viewed 43 times
2 Answers
0
Yes, but it requires to you mark them before you send them in the batch. For example, you can use custom text fields and when you set your bulk send (what you call batch) you can set this custom field. You can later search for envelopes based on custom fields values. You can also use other metadata. The envelopes sent from batch are indistinguishable once they were created from any other envelopes, just like envelopes created from templates are. You have to mark them yourself to be able to later find them.

Inbar Gazit
- 12,566
- 1
- 16
- 23
-
and to get a batch list similar to your docusign interface, what is the correct method? – Geisy Alfonso Martínez Dec 22 '21 at 14:51
-
I posted another question with the code, it returns null according to the method in the documentation. – Geisy Alfonso Martínez Dec 22 '21 at 15:05
-
https://developers.docusign.com/docs/esign-rest-api/how-to/bulk-send-envelopes/ did you follow this? – Inbar Gazit Dec 22 '21 at 18:59
-
Im able to do bulk send, but the list batch acording to your method result null to me, except if I pass some Id , var option = new BulkEnvelopesApi.GetBulkSendBatchesOptions { status = "all", count = numberOfItems.ToString(), batchIds = "XXXXXXXXXX", }; the model in view is IEnumerable
– Geisy Alfonso Martínez Dec 22 '21 at 20:39 -
you need to pass the batchId, you get that when you create the batch – Inbar Gazit Dec 22 '21 at 22:48
-
To have a list of batches, I have to pass the batchId of eachone? – Geisy Alfonso Martínez Dec 22 '21 at 23:42
-
I mean, you have to go through the list first to get each BatchId, and then get the Batches list, isn't there another way? – Geisy Alfonso Martínez Dec 22 '21 at 23:49
-
I'm confused, not clear what you're trying to do. Sorry. – Inbar Gazit Dec 23 '21 at 00:26
-
I posted my question with the method GetBulkSendBatches to get a list of Batches but it returns null – Geisy Alfonso Martínez Dec 23 '21 at 14:54
-
Did you try to get the batchId when you inmate it? one at a time? – Inbar Gazit Dec 23 '21 at 18:51
-
Like thisone its ok var options = new BulkEnvelopesApi.GetBulkSendBatchesOptions { status = "all", count = numberOfItems.ToString(), batchIds = "88b08888-74b0-4683-9fd2-xxxxxx, f1897948-ccb2-45ed-b708-xxxxxxx", }; IEnumerable
listeBatchs; listeBatchs = bulkEnvelopesApi.GetBulkSendBatches(accountId, options).BulkBatchSummaries; – Geisy Alfonso Martínez Dec 23 '21 at 20:49 -
we can see both of them batches in the list, but its not supposed to passed them(BatchId), its not required according documentation, just accountId for GetBulkSendBatches method or there is something that I'm missing ? – Geisy Alfonso Martínez Dec 23 '21 at 20:54
-
You probably mean to use https://developers.docusign.com/docs/esign-rest-api/reference/bulkenvelopes/bulksend/getbulksendbatchstatus/ and not GetBulkSendBatches. The one I send you is for a single batch with a batchId. The one you pointed out is for many batches, not sure why you would need this one. – Inbar Gazit Dec 23 '21 at 20:58
-
yes, a Batches List thats what I want – Geisy Alfonso Martínez Dec 23 '21 at 21:01
-
But getBulkSendBatchStatus need BatchId is required, when I did the envelopes List for ListStatusChanges its not required (envelopeId, just accountId), what is the similar to do a list of batches? – Geisy Alfonso Martínez Dec 23 '21 at 21:06
-
Otherwise I have to store a list of batchId in a database, every time I do a bulk sending, to use it later to get the batch list. Is it like this or can I get the BatchId of each of the lines of my batch list with another method? – Geisy Alfonso Martínez Dec 23 '21 at 21:19
-
yes, if that's what you need to do - you'll have to store the batchId in a database. Not sure this scenario is otherwise supported. – Inbar Gazit Dec 23 '21 at 22:00
-
ah ok, because for the list of envelopes with ListStatusChange it was not needed – Geisy Alfonso Martínez Dec 23 '21 at 22:25
-
thank you very much, sorry for the inconvenience. – Geisy Alfonso Martínez Dec 23 '21 at 22:25
-
Yes, not the same, envelopes and batches – Inbar Gazit Dec 24 '21 at 00:08
-
thank you, thats what i did, now its ok Inbar Gazit, when the signer complete the sent document, a docusign login page is showed to invite user to create an account or to login, how can I avoid that? – Geisy Alfonso Martínez Jan 11 '22 at 18:05
0
You can simply store batch id when u use bulk send api, once you store, you can fetch all envelopes using code below
// C# Code
var bulkEnvelopesApi = CustomApi.Instance.BulkEnvelopes(accessToken, basePath);
var batchStatus = await bulkEnvelopesApi.GetBulkSendBatchStatusAsync(accountId, batchId);
if (batchStatus.Failed.Equals("0", StringComparison.OrdinalIgnoreCase)
&& batchStatus.Queued.Equals("0", StringComparison.OrdinalIgnoreCase)
&& !batchStatus.Sent.Equals("0", StringComparison.OrdinalIgnoreCase))
{
var bulkSendEnvelopes = await bulkEnvelopesApi.GetBulkSendBatchEnvelopesAsync(accountId, batchId);
return bulkSendEnvelopes?.Envelopes;
}

Shyam
- 182
- 1
- 14