Page tree
Skip to end of metadata
Go to start of metadata

The webAPI allows the client to remote control a printer, guaranteeing full access to the information and changing queue items as he pleases. It works by URL calls, which have different parameters that we will see below. 

Units

All units, which aren't specifically defined, are point units. 


Action

The "Action" is an URL call parameter, which allows the client to request information or change current queue items interacting with the printer. 

The base URL to access it is http://\[IP\]:\[PORT\]/. The data returned by calls is in XML format. Each call is done using HTTP GET method. Parameters are added onto the base URL like normal. The first parameter should be always the command (?action).

Most action commands require a UUID to be passed. This is the ID of the job, obtained from the printer. 

Authenticate your Web API requests by providing a token. Preferred are tokens to be sent in the Authorization HTTP header of your outbound requests. However, you may also pass tokens in all Web API calls as a parameter called token.


Action calls

printerInfo

Request action with no parameters that returns an XML file with all the printer information.

jobInfo

Request action with UUID as a parameter that returns us all the information of the requested job.

moveUpJob

The client gives a UUID as a parameter and the printer moves this item one position up on the queue.

moveDownJob

The client gives a UUID as a parameter and the printer moves this item one position down on the queue.

moveJob

The client gives a UUID as a parameter and the printer moves this item in one specified position on the queue.

enableJob

The client gives a UUID and an Enable status (being possible: true, false, yes, no...) as a parameter and the printer will put the item enable or not to be printed.

startQueue

Start printing action. No more parameters to give. The printer will only print those items with the Enable parameter on true.

stopQueue

No more parameters to give. The printer stops all print process.

addJob

Action in POST method. The client must give a Scheme type, the Enable position and the Title of the new job and then the printer takes that information and adds a new job with this information.

jobPreviewReturns a png encoded inside the XML.
setJobParameters

Modifies the parameters (scheme, programmedHeight, copies) of an existing job

exportJob

Download a job as .xjb

exportSchemeDownload one or multiple schemes as a .zip
importSchemeImport one or multiple schemes from a .zip
quitAttempts to close the Print Server

Every action will return at least an XML with a RequestStatus, which returns an "Ok" for well-executed actions or an "Error" for bad-executed actions. In both cases the XML will also include a RequestMessage, which will inform us the kind of action or error we've done. 

For well-executed actions:

<MoveDownJob UUID="384b96be-369a-4224-b459-12090c62091f" RequestStatus="OK" RequestMessage="Job 384b96be-369a-4224- b459-12090c62091f moved"/>

For bad-executed actions:

<MoveUpJob UUID="38b96be-369a-4224-b459-12090c62091f" RequestStatus="Error" RequestMessage="Job 38b96be-369a-4224- b459-12090c62091f not found"/>

It works on every action, not only with moveUpJob and moveDownJob


printerInfo

The base parameter to get the printer information is: ?action=printerInfo. Using this parameter will return an XML in the following format.

<PrinterInfo Printer=(string) Status=(string) Active=\[Yes|No\] ClusterID=(string) DefaultScheme=(string) PendingSize=(float) SelectedSize=(float) DoneSize=(float) Workstation=(string)>
<JobList> 
<Job UUID=(string) StatusID=(string) Status=(string) Enabled=(String) LastError=(string)> 
... 
</Job> 
... 
</Job> 
</JobList> 
<Schemes> <Scheme Name=(string)/> 
</Schemes>
<Layouts> <Layout Name=(string)/> 
</Layouts> 
</PrinterInfo>

In the PrinterInfo action we can see the following parameters returned in the XML:

  • Printer is the name of the printer that we refer. An example of that would be: Printer="Generic Printer".
  • Status is a string with seven options: error, idle, active, canceling, deleting, finished, loading.
    • Error to tell the client there is an error with this job. 
    • Idle if the printer is waiting for enabled item to be printed
    • Active for the job is being printed.
    • Canceling appears by the time the printer is canceling any job.
    • Deleting while any job is being deleted-
    • Finished is for finished jobs.
    • Loading for any job, which is being load to be printed.

  • Active can only be yes or no. It indicates if the queue is active to print any enabled item or inactive to print.
  • DefaultScheme refers the scheme that we will use as default on every print. In our case it will has two options:

    <Scheme Name="197 - Carta_Pigment_i1_10012012"/>

    or

    <Scheme Name="Esquema tipus Roland"/>


  • PendingSize refers the length that is pending, in the queue, to be printed.
  • SelectedSize refers the length that has selected, in the queue, to be printed.
  • DoneSize refers the length that has been printed and still appears in the queue.
  • Workstation is the name of the computer that is running printEngine.

Inside the action we have a JobList and the Schemes.

  • JobList shows all the jobs we've sent to the printer, giving all the information that it includes. The information about the jobs is explained in the next section.
  • Schemes include every the scheme we've got on the printer.
  • Scheme: The scheme is a configuration for a Printer. A printer can include more than one scheme, and normally it does. That's why we must choose the scheme when we send a job to be printed.

jobInfo

The base parameter to get a job information is: ?action=jobInfo&UUID=(string). Using this parameter it will return an XML in the following format. When the client uses the action; printerInfo, it returns all the printer information including all the jobs, so the jobInfo is included in the printerInfo.

<Job UUID=(string) StatusID=(string) Status=(string) Enabled=(String) 
 LastError=(string) RequestStatus=(OK|Error)> 
 <Title>ORD-12065295-5A150_002.xjb</Title> 
 <Scheme>197 - Carta_Pigment_i1_10012012</Scheme> 
 <TempPath> 
 C:\Documents and Settings\All Users\Documentos 
 \neoPrintEngine\Jobs\Generic Printer\384b96be-369a-4224- 
 b459-12090c62091f 
 </TempPath> 
 <PageSpace>0.000000</PageSpace> 
 <MultichannelOverprint>no</MultichannelOverprint> 
 <Hour>1367924640</Hour> 
 <LastActivity>1372418206</LastActivity> 
 <PrintWidth>4535.520000</PrintWidth> 
 <PrintHeight>750.289134</PrintHeight> 
 <Pages Count="3"> 
 <Page Id="0" SourceWidth="0.000000" SourceHeight="0.000000" 
 Width="4535.520000" Height="112.320000" DoneHeight="0.000000" 
 ProgrammedHeight="112.320000" Flags="0"/> 
 <Page Id="1" SourceWidth="0.000000" SourceHeight="0.000000" 
 Width="4535.433071" Height="566.929134" DoneHeight="0.000000" 
 ProgrammedHeight="566.929134" Flags="1"/> 
 <Page Id="2" SourceWidth="0.000000" SourceHeight="0.000000" 
 Width="4535.520000" Height="71.040000" DoneHeight="0.000000" 
 ProgrammedHeight="71.040000" Flags="0"/> 
 </Pages> 
 <PrintedLength>19.200000</PrintedLength> 
 <LastErrorMessage/> 
 </JobInfo>

The parameters we get form the Job are the following ones.

  • UUID from the job we asked information.
  • Status already explained in the printerInfo section.
  • StatusID is the internal code to refer to every status.
    • Error -1
    • Idle  0 
    • Active  1 
    • Canceling  2 
    • Deleting  3 
    • Finished  4 
    • Loading  5

  • Enabled has two options (yes|no). This parameter shows if the job is enabled to be printed, when the printer is active.
  • LastError as it says, shows the last error occurred in the job.
  • RequestStatus already explained.

After that, the XML includes all the specific information from the job. Which is:

  • Title: Is the title of the job we are working.
  • Scheme: Is the scheme, which the printer will use for this job.
  • TempPath: Is the path where the document we are printing is saved.
  • Hour: Hour when the job has been logged, in timestamp.
  • LastActivity: Last printing activity time, in timestamp too.
  • PrintWidth: Is the width of the job the printer is going to print
  • PrintHeight: is the Height of the job the printer is going to print
  • Pages: Shows the number of pages has the job
    • Id: Number of page. 
    • SourceWidth: ———————————————
    • SourceHeight: ————————————————
    • Width: —————————————————————
    • Height: ————————————————————
    • DoneHeight :Height already printed.
    • ProgrammedHeight: Height, which is going to be printed.

  • PrintedLenght: Total length printed of this job.
  • LastErrorMessage: As it says, the last error occurred on this job.


jobPreview 

The base parameter to get a job information is: ?action=jobPreview&UUID=(string)[&Size=(integer)]. Size is the preview size in pixels. Using this parameter it will return an XML in the following format. 

<JobPreview UUID=(string) Format="png">
(Data...)
 </JobPreview>

The parameters we get from the Job are the following ones.

  • UUID from the job we asked information.
  • Format of the embedded image. By default is png. 

After that, the XML includes all the specific information from the job. Which is:

  • Data encoded in Base64.


deleteJob 

The base parameters to delete a job are: ?action=deleteJob&UUID=(string).

Parameters: 
UUID(required): String which refers an unique alphanumerical number that corresponds to an unique job. 

Using this action it will return a XML with a RequestStatus and a RequestMessage. 


moveUpJob 

The base parameters to move a job up in the queue are: ?action=moveUpJob&UUID=(string). 

Parameters: 
UUID(required): String which refers an unique alphanumerical number that corresponds to an unique job. 

Using this action it will return an XML with a RequestStatus and a RequestMessage. 


moveDownJob 

The base parameters to move a job down in the queue are: ?action=moveDownJob&UUID=(string). 

Parameters:
UUID(required): String which refers an unique alphanumerical number that corresponds to an unique job. 

Using this action it will return an XML with a RequestStatus and a RequestMessage.


moveJob 

The base parameters to move a job to the specified position in the queue are: ?action=moveJob&UUID=(string)&Position=(number). 

Parameters:
UUID(required): String which refers an unique alphanumerical number that corresponds to an unique job. 

Position(required): Number specifying the new position in the list.  

Using this action it will return an XML with a RequestStatus and a RequestMessage.


enableJob 

The base parameters to enable a job are: ?action=enableJob&UUID=(string)&Enable=(yes|no). 

Parameters: 
UUID(required): String which refers an unique alphanumerical number that corresponds to an unique job. 
Enable(required): String with two options. Yes or no. It tells if the job is prepared to be printed, or not. 

Using this action it will return an XML with a RequestStatus and a RequestMessage. 


startQueue 

The base parameter to start the queue is: ?action=startQueue.

Using this action it will return an XML with a RequestStatus and a RequestMessage. 


addJob 

The base parameters to add a new job are ?action=addJob&Scheme=(string)&Enabled=(true|false)&Title=(string)&Layout=(string)&Width=(float)&Height=(float)...


Parameters:

  • Scheme (Required): String; The scheme for the new job
  • Title (Required): String; The title for the new job
  • Enabled (Required): Boolean; If the new job will be enabled
  • Layout (Optional): String; The name of the layout (as provided by printerInfo) for the new job
  • Width (Optional): Float;
  • Height (Optional): Float;
  • Copies (Optional): Integer; The new number of copies of the job
  • OriginX (Optional): Float; The new programmed origin position of the job, any unit
  • OriginY (Optional): Float; The new programmed origin position of the job, any unit
  • OutputFileName (Optional): Drivers with output file formats, name of the file for the specific printing job 
  • ComputerID: String; The name of the client computer that sends the job
  • UserID: String; The username of the client computer

Additionally to this GET parameters an additional parameter named 'file' will have to be submitted via POST in the same request.



setJobParameters

The base parameters to change a job parameters ?action=setJobParameters&UUID=(string)&Scheme=(string)[&ProgrammedHeight=(float)&Copies=(integer)]...

Parameters:

  • UUID (Required): String; The UUID of the job
  • Scheme (Required): String; The new scheme of the job
  • ProgrammedHeight (Optional): Float; The new programmed height of the job, any unit
  • Copies (Optional): Integer; The new number of copies of the job
  • OriginX (Optional): Float; The new programmed origin position of the job, any unit
  • OriginY (Optional): Float; The new programmed origin position of the job, any unit
  • OutputFileName (Optional): Drivers with output file formats, name of the file for the specific printing job 

If ProgrammedHeight or copies is omitted, its value is not modified

Using this action it will return an XML with a RequestStatus and a RequestMessage.


exportJob 

The base parameters to export a job are: ?action=exportJob&UUID=(string)[&base64=(yes|(no value))]. If base64 is set to any value the response will be returned in base64 inside an XML in the following format. 

<JobExport UUID=(string)>
(Base64 encoded Data...)
 </JobExport>

If the base64 parameter is not submitted, the .xjb will be sent through HTTP like a regular file.


exportScheme

The parameters to export a scheme are: ?action=exportScheme&Name=(string). The API will return a .zip file upon success or 404 Scheme not Found upon failure 

Parameters:

Name (Required): String; The name of the scheme to export. You can use the special value "*" to export all schemes


importScheme

The parameters to import a scheme are: ?action=importScheme&[Force=(yes|no value)]. Additionally one, or multiple ".zip" file(s) will have to be sent via POST parameters, as files

Parameters:

Force (Optional): If the parameter force is passed with any value and the scheme inside the zip file already exists, it will be deleted before importing. This flag is potentially dangerous, use with caution

The response for this API will have the following syntax:

<?xml version="1.0" encoding="utf-8"?>
<ImportScheme>
  <Scheme Name="First Scheme"/>
  ...
  <Scheme Name="Last Scheme" Status="Error"/>
</ImportScheme>

A <Scheme> list of all schemes that have been attempted to import, if a scheme cannot be imported it will have the Status value "Error". This can be because the scheme already exists, you can use &Force=yes to delete the original scheme before importing


quit 

Attempts to close the Print Server, if the Print Server is printing or ripping it will not close

The only parameter needed to close the Print Server is: ?action=quit.