timestamp(Time when the combined submission was processed) - Example: 20181029094531

date - Example: 20181029

year - Example: 2018

month - Example: 10

day - Example: 29

Click "Create"

Now that you've created an AWS S3 integration, we will upload any generated PDFs to your S3 bucket. You can test the integration by generating a new live PDF. (Test PDFs are skipped.)

When you view a submission or combined submission in the web UI, you will see the S3 upload status in the Actions section at the bottom of the page.

FAQ

Does FormAPI still keep a copy of the PDF?

Yes. This AWS S3 integration is just a one-way file upload, but FormAPI continues to store your template PDFs and generated PDFs. We serve our own copy of the generated PDF when you request a download URL. We will also use our own copy of the PDF when merging them into a "combined submission".

Does FormAPI delete the PDF from my S3 bucket when a submission expires?

No. FormAPI will only delete our own copy of the PDF when a submission expires. We will
never delete a PDF in your custom S3 bucket.

How can I tell when the PDF has been uploaded to my custom S3 bucket?

One thing to be aware of is that the submission state will change to processed as soon as our copy of the PDF is ready, but it might take a few seconds before the PDF is uploaded into your custom S3 bucket. The AWS integration upload happens after the initial processing is completed.

If you need to know when the PDF is available in your own S3 bucket, you can check the actions array in the API response. This array will be empty before the submission is processed. As soon as the the submission is processed, it will contain an entry for the aws_s3_upload action. This action's state will be pending until the file has been uploaded into your S3 bucket, and then it will change to processed.

For example, here's how you could wait for the PDF to be uploaded to your own S3 bucket (in JavaScript):

This code assumes that you only have a single aws_s3_upload action. Note that it is possible to configure multiple AWS integrations, so you can store the PDF in multiple buckets.

Another thing you could do is set up an AWS S3 event notification. You could send a webhook to your server as soon as the PDF has been uploaded to your S3 bucket. This means that you wouldn't need to do any polling.

What if my "path template" generates a duplicate key?

If a path template generates a duplicate key, the previous file will be overridden with the new file. If you don't want this to happen, make sure you use at least one variable that is always unique, such as submission_id.

Don't rely on the timestamp variable to provide unique filenames, because multiple PDFs can be processed in the same second.