The Download URL is empty
Reasons why the download URL can be empty
The Document’s status is "draft"
If you did not specify a status
attribute when creating your Document, its status will be set to draft
by default.
The Document’s status is "pending" or "generating"
If you specified the pending
status when creating your Document, it has been queued for generation. Its status can be either pending
or generating
when you receive the response to your creating request.
You need to fetch the Document again in a loop until its status becomes success
or failure
, or use a webhook endpoint to react to its generation.
The Document’s status is "failure"
If the Document’s generation failed, its status will be set to failure
and its download URL will be null
.
You can retry generating the Document by setting its status back to pending
.
Alternative: Switch to the "sync" workflow
If you really need to get the download URL right in the Document’s creation response you can use our sync generation endpoint.
A word on the preview URL attribute
Don't use preview_url
The preview_url
attribute is not a download URL. Its only purpose is to show a preview of the Document (hence the "preview" in its name). This is useful if you want to show a draft version of the Document before you actually generate it.
A good example of using preview_url
is PDFMonkey's dashboard itself. When you create a Document, it starts as a draft you can preview. You can change the Document data as many times as you want until you're ready to generate it. The preview on the right is what's returned by preview_url
.
Last updated