Submit a job using a job ticket

This Web service submits a file on the local file system to a hot folder input device using a Job Definition Format (JDF) job ticket. You can use the job ticket to override the values of certain job attributes.

HTTP method

POST

URI

/aiwservices/v1/inputdevice/InputDeviceID/job

InputDeviceID is the name of the target input device in the Ricoh ProcessDirector system.

Request headers

ippdcredential

<credential token="value" />

Accept-Language (optional)

lang

Supported language values:

de German
en US English (default)
es Spanish
fr French
it Italian
ja Japanese
pt_BR Brazilian Portuguese

Request body

The job ticket file on the local file system and any other required files. The job ticket file might contain either the absolute path to the data files or just the data file names. If an absolute path is specified, you do not have to include the data files. If the job ticket file contains just the file name, the data files must be sent first, followed by the job ticket file.
The Content-Type of the request should be multipart/form-data. You can use a client API like commons-httpclient or a command line tool like cURL to POST the file.

Return codes

  • 202 Accepted
  • 400 Bad Request
  • 401 Unauthorized
  • 404 Not Found
  • 500 Internal Server Error
  • 501 Not Implemented

Response body on success

Ricoh ProcessDirector sends a return code 202 to indicate whether the command was accepted for processing. No other information is returned.

Examples

Sample request

Submit a JDF file and a data file to an input device named HotFolderJDF.

http://hostname:15080/aiwservices/v1/inputdevice/HotFolderJDF/job

Using Commons HttpClient:

// Set up the Post method with the URI to invoke 
PostMethod method = new PostMethod(
"http://hostname:15080/aiwservices/v1/InputDeviceJDFHF/HotFolderJDF/job");
// add credential header
File dataFile = new File("c:/test.pdf");
File jdfFile = new File(“c:/test.jdf”);
Part[] parts = { 
             new FilePart(dataFile.getName(),  dataFile),
             new FilePart(jdfFile.getName(),  jdfFile)
};
method.setRequestEntity(new MultipartRequestEntity(parts, method.getParams());

HttpClient client = new HttpClient();
int status = client.executeMethod(filePost); 
….

Using Commons HttpClient over SSL

….
// Set up the Post method with the URI to invoke
Protocol easyhttps = new Protocol
("https", new EasySSLProtocolSocketFactory(), 15443);
String uriString = 
http://hostname:15080/aiwservices/v1/inputdevice/HotFolderJDF/job;
URI uri = new URI(uriString, true);
PostMethod method = new PostMethod(uri.getPathQuery());
HostConfiguration hc = new HostConfiguration();
hc.setHost(uri.getHost(), uri.getPort(), easyhttps);

// add credential header
File dataFile = new File("c:/test.pdf");
File jdfFile = new File(“c:/test.jdf”);
Part[] parts = { 
             new FilePart(dataFile.getName(),  dataFile),
             new FilePart(jdfFile.getName(),  jdfFile)
};
method.setRequestEntity(new MultipartRequestEntity(parts, method.getParams());
HttpClient client = new HttpClient();
int statusCode = client.executeMethod(hc, method);
….

Using cURL

curl -F “upload=@c:/test.pdf” -F "upload=@c:/test.jdf" -H "ippdcredential:
<credential token='-2921201405796490177'/>"
http://hostname:15080/aiwservices/v1/inputdevice/HotFolderJDF/job

To include more than one file:
  • In Commons HttpClient, insert additional file definitions, such as:
    • File b = new File(myfile.pdf);
    • File l = new File(mylist.lst);
  • In cURL, insert additional -F flags:
    • -F "upload=@c:\myfile.pdf"
    • -F "upload=@c:\mylist.lst"
 
Copyright © 2015, 2018