# Creating a delay for api purposes

**URL:** https://community.triggre.com/t/creating-a-delay-for-api-purposes/611
**Category:** Feature requests
**Created:** [December 27, 2023, 3:02pm UTC](https://community.triggre.com/t/creating-a-delay-for-api-purposes/611 "2023-12-27T15:02:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Albert.wemmers](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Albert.wemmers](https://community.triggre.com/u/Albert.wemmers)
#### Post date: [December 27, 2023, 3:02pm UTC](https://community.triggre.com/t/creating-a-delay-for-api-purposes/611/1 "2023-12-27T15:02:06Z")

</div>

For example: if you need to wait for a document to be generated before fetching it.

I have found a solution for now, it’s generating a pdf document before creating the api call.

---

<div class="post-metadata">

### Author: ![Jesse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.triggre.com/jesse/32/88_2.png) [@Jesse](https://community.triggre.com/u/Jesse)
#### Post date: [December 27, 2023, 6:38pm UTC](https://community.triggre.com/t/creating-a-delay-for-api-purposes/611/2 "2023-12-27T18:38:29Z")

</div>

Hi @Albert.wemmers,

Thanks for raising this point. We have plans for a delay function, though early stages.

There are more situations in which a delay can be useful, such as rate limits on APIs.

We are trying to find the most versatile, simple solution that fits into the platform best.

To help us; is the wait time in your case a minimum wait time or is there maybe a polling function to check if your document is ready?

This info can help us in our design process, and would be greatly appreciated!

---

<div class="post-metadata">

### Author: ![Albert.wemmers](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Albert.wemmers](https://community.triggre.com/u/Albert.wemmers)
#### Post date: [December 27, 2023, 6:52pm UTC](https://community.triggre.com/t/creating-a-delay-for-api-purposes/611/3 "2023-12-27T18:52:10Z")

</div>

Hi Jesse,

Thank you for the quick response. To clarify, I’m creating a delay using the built-in PDF generator from Triggre before fetching the generated PDF I want to get via API. In my case, I know the documents take like 0.2s to generate (this info was given to me by PDFmonkey), so a minimum wait time would be handy. Before I had my solution, I got an empty response, which was quite confusing.

Hope this helps!

---

<div class="post-metadata">

### Author: ![Jesse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.triggre.com/jesse/32/88_2.png) [@Jesse](https://community.triggre.com/u/Jesse)
#### Post date: [December 27, 2023, 7:21pm UTC](https://community.triggre.com/t/creating-a-delay-for-api-purposes/611/4 "2023-12-27T19:21:37Z")

</div>

Thanks @Albert.wemmers, it helps indeed!

---

<div class="post-metadata">

### Author: ![Jesse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.triggre.com/jesse/32/88_2.png) [@Jesse](https://community.triggre.com/u/Jesse)
#### Post date: [January 5, 2024, 2:04pm UTC](https://community.triggre.com/t/creating-a-delay-for-api-purposes/611/5 "2024-01-05T14:04:52Z")

</div>

Hi @Albert.wemmers,

After reading the documentation of PDF Monkey; perhaps you can set the _status_ field to _pending_. This will immediately invoke generation of the document, and perhaps this means that the Web API call will block until the document is generated?

See this article about the document URL being empty: [The Download URL is empty - PDFMonkey](https://docs.pdfmonkey.io/frequent-questions/troubleshooting/empty-download-url)

I was looking for a webhook that you can specify that PDF Monkey will call upon completion of the document, with the document ID for example. That would allow you to set up an asynchronous process like it would usually work with APIs. However, I didn’t find anything, other than hopefully this solution with the document status.

Hope this helps!
