The documents API provides functionality for generating PDF documents from prebuilt document templates.
Generates a single PDF document.
https://api.astradoc.io/documents/v1.0/generatedocument
Property Type Required Description templateId StringYes The Id of the document template used to generate the PDF file. templateVersion StringNo The version of the template used to generate the PDF file. Defaults to the latest published version. Can be draft or number for specific version. templateData StringYes A serialized JSON object containing the payload used for template data.
Property Type Description Success BoolA Boolean indicating whether or not the request was successful. Message StringA message containing error information if the request was unsuccessful. Data StringA base64 string containing a PDF file.
Generates a collection of PDF documents.
While this API is capable of generating many PDF documents in a single request, if the number of documents to generate is large and the request takes an extended time to complete, it may be better to rather use the Jobs API to generate documents.
https://api.astradoc.io/documents/v1.0/generatedocuments
Property Type Required Description documents DocumentData[]Yes An array of DocumentData objects containing data for each of the documents being generated.
Property Type Required Description templateId StringYes The Id of the document template used to generate the PDF file. templateVersion StringNo The version of the template used to generate the PDF file. Defaults to the latest published version. Can be draft or number for specific version. templateData StringYes A serialized JSON object containing the payload used for template data. uniqueIdentifier StringYes A string uniquely identifying this template data set. Used to track the individual PDF documents amongst the results.
Property Type Description Success BoolA Boolean indicating whether or not the request was successful. Message StringA message containing error information if the request was unsuccessful. Data DocumentCollectionResult[]An array of DocumentCollectionResult objects.
Property Type Description Base64 BoolA base64 string containing a PDF file. UniqueIdentifier StringA string uniquely identifying this result. Will match the uniqueIdentifier string provided in the original request.