Articles on: Integrations

How to integrate with Xano?

Introduction


Xano is the fastest way to build a scalable backend for your App using No Code. Each Xano account comes with a scalable server, a flexible database, and a No Code API builder that can transform, filter, and integrate with data from anywhere. Xano is one of the few no code backend platforms that provides a comprehensive Database test environment, allowing you to switch between production and test data easily.

You can use PDF Generator API with Xano to quickly generate PDF documents using the data you already have in your Xano application (e.g. store orders, database records).

Example API
Download Snippet from Xano Marketplace
Example documents
API documentation
Download Example Invoice template
Download Example Invoice data

Example API


You can try out our example API documentation here. You can use 389486 as template_id value for in generate_document and get_editor_url endpoints. In the orders endpoint, you can use 1 as the orders_id value to generate an invoice for the order.

Setup


To use PDF Generator API with Xano, you need a PDF Generator API account. You can create a free Sandbox Account. You can use the free Sandbox Account for 1 month to evaluate and integrate the API. The Sandbox Account allows you to make 2500 merges per month.

The monthly usage (merges) is calculated based on the number of document generation requests multiplied by the number of unique datasets in the request. Read more

Download snippet


You can download the snipped from the Xano Marketplace and start using the PDF Generation API functions in your backend. You can read more about Xano snippets from their help page here.

Configuration


We use Xano environment variables to store API key, API secret and workspace values. You need to copy the PDF Generator API key and secret from the Account Settings view to Xano General Settings. The API key and secret are used to authenticate your request and workspace identifier specifies the request user context

pdf_api_key - You can find your PDF Generator API key from the Account Settings view in PDF Generator API.
pdf_api_secret - You can find your PDF Generator API secret from the Account Settings view in PDF Generator API.
pdf_api_workspace - The Workspace identifier specifies the request user context. Your default workspace identifier is the email you used to sign up to PDF Generator API. You can also set any other string value. If the workspace doesn't exist yet, it is automatically created when an API request is made.

PDF Generator API key and secret in Account Settings

Xano General Settings


Functions


We have created three main functions that allow you to fetch a list of templates, open a template in the editor and merge your data with a template to generate a document.

generate_document


The generate_document function is a wrapper for our Generate Document API endpoint and you can use the function to merge data from your application with a template created in PDF Generator API. The function accepts the same parameters as available for the API endpoint.

Function "generate_document"

get_editor_url


The get_editor_url function is a wrapper for our Open Editor API endpoint and you can use the function to generate URL to open the editor view from your application. The function accepts the same parameters as available for the API endpoint.

Function "get_editor_url"

get_templates


The get_templates function is a wrapper for our Get templates API endpoint and you can use the function to fetch a list of templates available for the workspace.

Function "get_templates"

API


The example API endpoints are created to show how to use PDF Generator API functions generate_document, get_templates and get_editor_url in your application endpoints. Besides preparing an endpoint for each function, we added an example endpoint that generates an invoice for an order.


Example endpoints

Updated on: 30/08/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!