Integrating with Xano

Help Center

Xano homepage

Xano lets you integrate with DocuGenerate to add document creation to your backend. Our snippet provides custom functions for handling templates and generating documents, helping you automate workflows and create high-quality PDFs effortlessly.

Summary

1. Add the DocuGenerate Snippet
2. Use the Functions to Build Logic
3. Generate Document (Function)
4. List Documents (Function)
5. Get Document (Function)
6. Update Document (Function)
7. Delete Document (Function)
8. Create Template (Function)
9. List Templates (Function)
10. Get Template (Function)
11. Update Template (Function)
12. Delete Template (Function)

1. Add the DocuGenerate Snippet

To get started, add the DocuGenerate snippet to your Xano account and configure it with your API key. We use Xano environment variables to securely store your API key.

Go to your DocuGenerate account settings to obtain your API Key and enter it the Xano workspace settings as the value for the docugenerate_api_key environment variable:

Configure the DocuGenerate API Key in Xano

2. Use the Functions to Build Logic

Once the snippet is added to your workspace, you can incorporate DocuGenerate’s custom functions to build the logic for your backend workflows.

  • Navigate to the Function Stack and click on the Add function button.
  • Expand the Custom Functions category and select one of DocuGenerate’s functions.
  • Configure the function by passing the required parameters.
  • Combine these functions with other Xano logic to create dynamic workflows.

Add custom function to DocuGenerate to the Function Stack

This allows you to define the exact logic for creating, updating, or managing templates and documents within your application.

3. Generate Document (Function)

This function creates a document from a specified template and dataset. Define the document’s name, filename, and format, and provide the data to populate fields in the template. The following inputs are customizable:

  • template_id (Template ID): Required to specify the template to use.
  • name (Text): Optional; assign a name to the generated document.
  • output_name (Text): Optional; define a custom filename for the output document.
  • output_format (Text): Optional; specify the output format (e.g., .pdf, .docx, .doc, .odt, .txt, .html, .png).
  • data (JSON): Required; data to populate fields in the template.

Generate document function

4. List Documents (Function)

Fetches a list of documents generated from a specific template, allowing you to track or display previously generated documents related to a template. It requires the following input:

  • template_id (Template ID): Required to specify the template for which to list documents.

List documents function

5. Get Document (Function)

This function retrieves metadata for a specific document, such as its filename, format, and document URI. The following input is required :

  • id (Document ID): Required to specify which document to retrieve.

Get document function

6. Update Document (Function)

Use this function to modify details of an existing document, such as updating the document’s name. The following inputs are expected:

  • id (Document ID): Required to specify the document to update.
  • name (Text): Optional; change the document’s name.

Update document function

7. Delete Document (Function)

This function deletes a document from your DocuGenerate account. It requires the following input:

  • id (Document ID): Required to specify the document to delete.

Delete document function

8. Create Template (Function)

Upload a new file as a template to your DocuGenerate account. This action also allows you to specify an optional name for the template. Once uploaded, this template can be used to generate documents based on user data. The following inputs are expected:

  • file (File upload): Required; upload the .docx file to use as a template.
  • name (Text): Optional; specify a name for the new template.

Create template function

9. List Templates (Function)

Use this call to retrieve a list of all templates stored in your DocuGenerate account, including basic details such as template names and IDs.

List templates function

10. Get Template (Function)

This call retrieves detailed information for a specific template, using the template’s unique ID. You can access attributes like the template’s name, tags, and format. This call requires the following input:

  • id (Template ID): Required to specify which template to retrieve.

Get template function

11. Update Template (Function)

Modify an existing template’s file or update its name. The following inputs are required:

  • id (Template ID): Required to specify the template to update.
  • file (File upload): Optional; upload a new file if updating the template content.
  • name (Text): Optional; update the template name.

Update template function

12. Delete Template (Function)

Remove a template from your DocuGenerate account. It requires the following input:

  • id (Template ID): Required to specify the template to delete.

Delete template function