We’re using the API to create a FormResponse. However after doing so, in the diary timeline the PDF is not generated. Instead there’s a link you can click to “Generate PDF”. How can this be done programmatically?
Can the “Produce a Templated Document” API endpoint somehow be used? It doesn’t mention that forms are valid template types.
Right now, the documented “Produce a Templated Document” endpoint only supports template types of “Quote”, “Work Order”, or “Invoice”, so it can’t be used to generate Form document PDFs.
In the API, a FormResponse can include a document_attachment_uuid, which links to the PDF attachment generated from the form response when one exists. The Form itself also references a document_template_uuid, which defines the layout and appearance of the form when it’s generated as a document.
If you need a PDF created as part of your integration today, one option is generating the PDF in your own system and attaching it to the Job as an Attachment, which makes it available via API and via the Job Diary.
If you’d like Form document generation added to the API, send a feature suggestion to support@servicem8.com (or via the Help Center request form) with your use case and a link to this thread.