LDD 5.x provides an interface called the Job Submission API (JSAPI) that allows web service–capable client software to interact with an LDD system. It supports both Representational State Transfer (REST) and SOAP web services. Client applications (such as eSF applications, the Microsoft Windows application software Select'N'Send, Lexmark Document Server Ports, and other applications) can use these services to run an LDD script or profile. Using JSAPI, the client software can also pass extra metadata to the running script or profile for additional processing or data capture.
Through the web service, clients can do the following:
Query the system for the profiles available to a client system based on the IP address of the client.
Submit documents to the LDD system.
Execute a profile to process documents.
Query the system for task progress and status.
The following requirements must be met for the web service to be available to a client:
A software client license is installed for the client.
The IP address of the client has been added to a software client group.
A solution with the client software script or profile is installed and added to a software client group.
Note: Multiple software client groups and client software solutions, scripts, or profiles can be installed on an LDD system. |
The LDD system is online.
REST JSAPI is available only in LDD 4.6.4.1 or later.
Notes:
Use the following HTTP methods when sending requests to the server:
POST—Create a new resource.
GET—Retrieve a resource.
PUT—Edit a resource.
DELETE—Remove a resource.
The base URI for RESTful JSAPI is
, where is the name or IP address of the load balancer.URI: /jsapi/v1/jobs Method: POST Version: v1 Content-type: multipart/form-data HTTP Form Parameters: (*Required parameter)
The following table lists the HTTP form parameters used when submitting a job:
Parameter key or object | Value type | Description |
---|---|---|
* Required parameter | ||
* | String | The name of the LDD profile to execute that is in an LDD SDK solution installed on an LDD system. For example, use with the TestSNS example solution. |
* | String | The name of the user who submitted the job. |
* | String | The IPv4 address of the client submitting the job. Note: IPv6 addresses are not supported. |
* | String | The host name of the client submitting the job. A fully qualified domain name (FQDN) is preferred. Note: If the host name cannot be determined, then use the IP address. |
* | String | The network card MAC address of the client submitting the job. For example, . |
* | Long | The time on the client when job submission started. Note: Use POSIX time format. For example, . |
* | String | The application ID where the job is coming from. Use one of the following IDs:
Note: The TestSNS example solution only looks for PNS and SNS IDs. |
String | Use either of the following:
Note: If no value is added, then the parameter defaults to . | |
String | The language used by the client. Use the format . For example, . The first two letters are important, and the next two letters are used only to distinguish between Simplified (zh_CN) and Traditional (zh_TW) Chinese.Notes:
| |
String, integer, etc. | Other metadata (key and value pairs) that is needed by the specific profile launched by the job submitted. | |
File object | File binary, file name, file extension, etc. The key name must be , where is the scan prompt number and is the number of the file returned by the prompt. For example, . and are both zero-based. |
indicates a successful response, and the HTTP header value indicates the new resource location.
201 Created Location: http://xxx.xxx.xxx.xxx:9780/jsapi/v1/jobs/123456 Content-Type: application/json [json-data]
{ "jobID": "123456" }
If the submission fails, then one of the following errors is returned:
{ "reason": "client software is not licensed" }
URI: /jsapi/v1/jobs/{jobID} Method: GET Version: v1 Parameters: (*Required parameter)
is the ID returned from the submit job request.
The following table lists the keys returned when querying a job status:
Key | Value type | Description |
---|---|---|
String | The ID of the job you are querying. | |
String | The status of the job you are querying. The status can be one of the following:
| |
Integer | The percentage of how much the profile initiated by the job is completed. Note: If the value is not or the value is not , then do not update in the profile. | |
String | The name of the solution on the LDD system that contains the profile. | |
String | The name of the task or script running on the LDD system for the profile. | |
Long | The time on the client when job submission started. The returned time is in POSIX time format. For example, . | |
Long | The time on the LDD system when the job started. The returned time is in POSIX time format. For example, .Note: If the job is not started, then this key is not added in the returned JSON data. | |
Long | The time on the LDD system when the job ended. The returned time is in POSIX time format. For example, .Note: If the job is not started, then this key is not added in the returned JSON data. | |
String | The name of the user who submitted the job. | |
String | The IPv4 address of the client submitting the job. Note: IPv6 addresses are not supported. | |
String | The host name of the client submitting the job. Note: If the host name cannot be determined, then the IP address appears. | |
String | The network card MAC address of the client submitting the job. | |
String | The application ID where the job is coming from. The ID can be one of the following:
Note: The TestSNS example solution only looks for PNS and SNS IDs. | |
String | The language used by the client. | |
String | The IP address of the LDD server processing this job. | |
String | The host name of the LDD server processing the job. Note: If the host name cannot be determined, then the IP address appears. | |
String | The name of the thread that is processing the job. For example, . |
200 OK Location: http://xxx.xxx.xxx.xxx:9780/jsapi/v1/jobs/123456 Content-Type: application/json Content-Length: xxxx { "jobId": "123456", "state": "running", "percentComplete": 40, “solutionName”: “TestSNS”, “taskName”: “testsns”, “submitTime”: 1340125377, “startTime”: 1340125400, “authId”: “smith”, “clientIPAddr”: “10.190.64.123”, “clientHostName”: “my-pc.area.company.com”, “clientMACAddr”: “12:BA:4F:67:91:B4”, “appId”: “mobile”, “language”: “en_US”, “srvIPAddr”: “10.190.64.75” “srvHostName”: “lddsrv1.area.company.com” “srvThreadName”: “workflow-29” }
SOAP JSAPI is available in LDD 4.3.x.x or later. We recommend using RESTful JSAPI instead of SOAP JSAPI to work with your client software applications. For more information, contact your Lexmark representative.
The following table lists the methods used with the SOAP Web Service:
Method | Target | Description | Parameters | Return values |
---|---|---|---|---|
Load balancer | Initiates a job submission session. |
|
| |
WebDAV | Submits files in response to . | See the WebDAV documentation | ||
LDD server | Provides answers for other prompts. |
| Reserved. | |
(optional) | LDD server | Requests for the next prompt. | —The session ID returned from the initial call. | —The parameters of returned changes based on the prompt type. —Shows the finish button. —Lets users go to the previous prompt. —Prompt type. |
(optional) | LDD server | Calls this method with the to determine if the job is successful. | —The session ID returned from the initial call. | —The percentage of the job completion that is updated as the script runs. —The session ID from the start of the job. —Shows the status of the job. —The time when the job started. —The time when the job ended. |