Automation Tutorial |
This automation tutorial is a simple end-to-end tutorial that explains Print Portal automation from authentication to printing a BarTender document. For a comprehensive list and explanation of the Print Portal API functions, refer to the Print Portal Swagger user interface.
The following notes will assist you in completing the tutorial:
The Print Portal user interface and documentation refer to root folders to describe the folders that you have configured to be available in Print Portal. The REST API refers to these folders as "libraries." You will see this difference when you request a list of (or enumerate) root folders. When you enumerate the contents of a root folder (library), all subfolders and their constituent items, either subfolders or documents, are listed.
A REST API is a software architectural style for acquiring and manipulating textual representations of the content of web resources. The Print Portal REST API represents data in JSON format, so data that is submitted and returned is in JSON format.
The examples in this tutorial start with URL requests and the response, using the browser. There are also JavaScript examples for programmatically constructing requests.
For the steps in this tutorial, the browser is on the same client that Print Portal is installed on, so "localhost" is used in the URI string.
Print Portal contains a REST API specification system called Swagger. Swagger can be considered a REST API help system that provides explanations for each function and an execution environment for testing requests.
|
To view the Swagger user interface, add "swagger" after "BarTender" in the BarTender URI, as follows: http://localhost/BarTender/swagger/ |
The Swagger presentation is divided into two halves. The top section contains API function explanations and the functionality to test API requests with. The bottom section, titled Models, provides an explanation for each function and its requirements. For example, if you need to know what the printRequestID is, go into the Models section, and then click PrintRequest to display a list of arguments and their definitions, one of which is printRequestID.
Describes the files and setup details that you need to have in place to successfully complete the tutorial.
Describes how to save the authentication token so that it can be passed into posting requests.
Describes how to generate the list of Print Portal root folders.
Describes how to generate the list of the contents of a root folder (library), including all subfolders and their constituent items, either subfolders or documents.
Enumerating Available Printers
Describes how to generate the list of the available printers.
Describes how to print documents, both with and without data entry form requirements.