Document API
Available in Cloud Business, Cloud Enterprise and Cloud Compliance.
The Document API allows you to interact with your labels, solutions, databases, and other documents, stored in the Loftware Control Center database, without interacting directly with Loftware Control Center.
Use Document API to:
-
Check-in / Check-out files and discard a checkout
-
Create files and folders
-
Copy and delete files
-
Get file information (like file IDs)
-
Get a list of files and workflows
You can use the Document API with your custom front end (UI applications) or back end (various services and integrations). Solutions made in Loftware Desktop Designer are not able to parse the JSON responses that come from the API. To parse the JSON responses, you can use the"Execute Script" action and write your own Phyton code.
You can test the Document API on the Developer Portal.
Note: The Developer Portal is where you can test Loftware APIs and see how they interact with your label printing system.
The Developer Portal includes auto-generated code samples in multiple programming languages.
To use Document API on the Developer Portal, you must:
-
Set up your Developer Portal account.
-
Create your free subscription for our Loftware Cloud product.
-
Connect your Developer Portal subscription with Control Center.
To set up your Developer Portal account, create subscriptions, and connect your Developer Portal to Loftware Control Center, follow the steps in Cloud integrations.
Using Document API
After you subscribe to Loftware Cloud API on the Developer Portal and connect your subscription, you can test how Document API works. There are four calls in Document APIs:
-
POST sends data to a server to create/update a resource.
-
PUT requests that the target resource updates its state.
-
GET requests data from a specified resource.
-
DELETE deletes data or objects from the specified source.
There are more than forty operations in Document API. The most commonly used are:
-
Lists the files and folder based on search criteria and other parameters starting in a root folder to find your files and folders and list them.
-
Checks the file in to check in labels or Checks the file out to check out labels.
-
Get available steps for the document to get/change workflow states.
-
Marks the files as deleted to delete files.
When you go to document API in the Developer portal and click on an operation, you get a list of possible API responses below the Request parameters. The most common responses are:
-
200 OK - Your call went through, and the operation was successful.
-
400 Bad Request - Bad request error.
-
404 Not Found - File with the provided name was not found.