Getting the filenames from API

We’re using the API to get the data for around 4,000 envelopes a day. (we can’t use webhooks)
But the file extension (or full filename) isn’t in the API data, so we don’t know if the file is going to be a ZIP or a PDF until we download it, and we need that so we can store it properly.

We have a process that uses cURL -I to get the header information for the download, but we’re doing around 4000 checks a day, so it takes hours just to get the filenames.
We could increase the parallelism it speed things up, but we’re probably just going to run it overnight if there’s no other solution.

Does anyone know if there’s a “tell” or something in the envelope_parties that would indicate what the file extension will be?

TIA
Pete

Hi Pete!

So as a rule of thumb, if it’s a single document envelope, the extension will be .pdf and if it is anything more than that, it will be a zip file.

Perhaps you could do a GET request to show your envelopes which will tell you how many documents are added, and you could maybe incorporate that into your workflow?

Hope that helps!

1 Like

Thanks for that, using a GET request to get the document count of each envelope is much faster than using cURL to get the download header data.

Our tests show that 100% of the envelopes with one document are PDFs.

1 Like

Ah lovely, glad to hear it! Let us know if you need anything else!