API
Integration with other systems (programs, websites) via API allows you to print labels, open the label template designer, get a list of label templates, perform tasks, etc. directly from these programs and websites.
The program supports 3 API options:
- REST API. Commands and data are transferred via HTTP protocol.
- Clipboard API. Commands and data are passed through the clipboard.
- Command line API. Commands and data are passed in the program launch line.
REST API
You can familiarize yourself with the REST API by visiting the AzureLabel API Documentation.
To work with this API, the program is launched in the API server mode; for this, the -apiserver
command
line parameter is used. You can also use the Windows Start menu to run the program in API server mode:
You can try the API in action by going to the local documentation page through the server API context menu in the tray:
Clipboard API
This API allows you to configure interaction with third-party programs that work on a remote server via RDP and there is no possibility of installing AzureLabel on a remote server. In this case, the data is transferred through a clipboard shared between the local computer and the remote server.
To work with this API, the program is launched in the API server mode; for this, the -apiserver
command
line parameter is used. You can also use the Windows Start menu to run the program in API server mode:
After the first launch, you need to set the flag through the context menu of the program in the tray:
(this corresponds to the setting "apiServer": {"useClipboardInsteadOfHttpForDataExchange": true}
in the program
settings file config.json).
In this API, the application receives requests through the clipboard and executes commands or sends data to the clipboard. To do this, the server scans the contents of the clipboard at intervals of 1 second. If the clipboard contains text data and this data is a request to the server, then the server executes the commands and places the response on the clipboard.
To transfer information to the program, text data of a special format is used in the form of a text block in the clipboard.
Request to the server
To request the server to the clipboard, you need to place the following lines:
-
AzureLabelClipboardAPIRequest
- Path along with parameters as in the REST API documentation. The path and parameters are concatenated according
to the URI composition rule. For example
/templates?encoding=utf-8&format=text
-
The data is in JSON format as it is described in the "Request body" section of the "/labels/print" section of the REST API documentation.
Optional string.
You can familiarize yourself with the REST API by visiting the AzureLabel API Documentation.
An example of a request to get a list of templates:
AzureLabelClipboardAPIRequest
/templates?encoding=utf-8&format=text
Server response
The program places a response on the clipboard, in which the first line is:
-
AzureLabelClipboardAPIAnswer::OK
- if there is no error. The following lines are data from the program, if the request meant receiving data from the program. -
AzureLabelClipboardAPIAnswer::ERROR
- in case of an error. The following lines are a description of the error.
Command line API
Execute a command from a data file
-allinonefile <Path to data file> [-encoding <File encoding>]
-
<Path to data file>. Full path to the data file.
The data is in JSON format as it is described in the "Request body" section of the "/labels/print" section of the REST API documentation.
One JSON object should be added to this data:
"request":"<Path>"
, where <Path> is the path as in the REST API documentation.
For example,"request":"/labels/print"
.You can familiarize yourself with the REST API by visiting the AzureLabel API Documentation.
-
<File encoding>. If not specified, the system default encoding will be used.
- utf-8. Data file in UTF-8 encoding.
- utf-16. Data file encoded in UTF-16.
- Code page identifier number. https://msdn.microsoft.com/en-us/library/dd317756%28v=VS.85%29.aspx . For example 1252.
Open template designer
-designer [{-templateid <Template ID> | -templatename <Template name>}]
Start API Server
-apiserver [-username <User name>] [-userpass <User password>]
-
<User name>. User name in the Users catalog. When a password is set to enter the program, if it is not specified or specified, but this is not in the program, the program entry window will be displayed.
-
<User password>. User password in the Users catalog. If not specified, but the user's password is set, then the program login window will be displayed.
Perform a task
-performtask -taskid <Task ID>
-
<Task ID>. Task ID from the Tasks catalog.
Upload list of templates
-templates -file <Path to the file> [-encoding <File encoding>] [-favorites] [-detailed]
-
<Path to the file>. Full path to the file where the list of label templates will be uploaded.
-
<File encoding>. If not specified, the system default encoding will be used.
- utf-8. Data file in UTF-8 encoding.
- utf-16. Data file encoded in UTF-16.
- Code page identifier number. https://msdn.microsoft.com/en-us/library/dd317756%28v=VS.85%29.aspx . For example 1252.
-
-favorites. Upload only "favorites".
-
-detailed. Upload detailed information.
Open User Guide
-help