Getting started with Tornado API

Watch a Quick Overview Video (6 Min)

This video provides an overview of the core endpoints used to generate a document with the Docmosis Tornado API.

Download the cutdown Postman collection

Set Up Postman (00:00)

A simplified Postman collection containing the endpoints used in this tutorial can be downloaded from the link below the video and imported into Postman.

The collection includes three API endpoints:

  • Status
  • Get Template Sample Data
  • Render

Each request uses the Base URL Postman variable. By default, this points to http://localhost:8080/api/. Verify that this value matches the Render Service URL configured in the Tornado Console before continuing.

Check API Connectivity (01:11)

The Status endpoint provides a quick way to confirm that Postman can communicate with the Tornado API.

If the Base URL is configured correctly, the request returns a 200 OK response together with information about the current Tornado instance.

Changing the endpoint to an invalid path returns a 404 Not Found response, confirming that Tornado is reachable but the requested endpoint does not exist.

If the Base URL itself is incorrect, no response is returned because Postman cannot establish a connection to Tornado. Correct the Base URL before proceeding.

Get Template Sample Data (02:10)

The Get Template Sample Data endpoint returns sample JSON data that matches the fields in a template.

The request requires a template name. The Postman collection uses the Welcome Template included with Tornado.

A successful request returns a 200 OK response containing JSONthat can be used as a starting point when developing document generation requests.

If an invalid template name is supplied, Tornado returns a 400response. Always review the response body, as Tornado includes detailedJSON describing the cause of the error whenever possible.

Generate a document (03:07)

The Render endpoint is the primary document generation service.

A render request requires at least three values:

  • Output name
  • Template name
  • Data

The file extension of the output name determines the format of the generated document. For example, specifying a .pdf extension produces a PDF document.

The supplied request uses the Welcome Template together with sampleJSONdata that matches the template fields. A successful request returns the generated document, which can be previewed directly in Postman.

If the request fails, inspect the response body for diagnostic information before troubleshooting further.

Add API Authentication (04:04)

An API access key can be configured from the Configuration page in the Tornado Console. The user has complete control over the length and complexity of the access key

After saving the configuration, requests that do not include the access key will fail. The response body explains why the request was rejected.

The access key can be supplied either as a request header or as a parameter in the request body. Once the correct key is included, the render request succeeds again.

The simplified Postman collection used in this tutorial contains only three endpoints. The Tornado Console provides a link to the complete OpenAPI specification, while the full Web Services Guide on the Docmosis Resources website contains comprehensive documentation for every available endpoint and parameter.

Next Steps

Continue learning about Tornado with these related resources:

  • Explore the Tornado API in More Detail: Access the complete OpenAPI specification or explore the Web Services Guide to learn more about the available endpoints, parameters, and features.
  • Create a Template: Create a template that matches your document from scratch by following the Template Tutorials.

Please reach out to our Support Team with any questions.