Print Files

Upload and check the status of documents ready for printing.

Documents to print

Print files are the core feature Wepa offers to customers. Most any office format (MS Office, PDF, plain text, etc.) can be uploaded, processed and available for print at any kiosk on the Wepa network.)

Authorized clients (acting on behalf of authorized users) may submit and make files available for printing through Wepa API. Several print options like page range, number of copies, color and duplex are supported along with the actual file, and can even be updated at later time after the initial file upload.

Uploadhttps://api.wepanow.com/resources/files/upload

  • POST
  • multipart/form-data

To upload a file for kiosk printing an appropriate HTTP request must be made containing the actual file. Print options may also be included given they are properly formatted and contain valid values. Here are a few examples:

Example 1.1 - A basic file upload request with no print options (assuming default values)
POST https://api.wepanow.com/resources/files/upload HTTP/1.1

Authorization: Bearer uceef192-04c6-4603-afcf-9463ed66135f 
Content-Type: multipart/form-data 

file = application/octet-stream [ file-data-here ]
Example 1.2 - File upload request including a few print options
POST https://api.wepanow.com/resources/files/upload HTTP/1.1

Authorization: Bearer uceef192-04c6-4603-afcf-9463ed66135f 
Content-Type: multipart/form-data 

file = application/octet-stream [ file-data-here ]
printRange = selectPages
printRangeStart = 8
printRangeEnd = 14 
orientation = landscape
color = true 
duplex = true 

With each successful file upload made a fileRefId value is returned in the response. This value can be used for any subsequent print option updates needed to be made, like changing from black/white to color. Just change the HTTP operation to a PUT and modify the URL to include the file reference ID.

Example 1.3 - Print options update changing the color option to black/white and orientation to portrait mode
PUT https://api.wepanow.com/resources/files/{fileRefId} HTTP/1.1

file = application/octet-stream [ file-data-here ]
orientation = portrait
color = false

Following is a table of all possible print options supported for upload and/or update.

API Files Resource - Form Parameters
Name Type Possible Values Default
file application/octet-stream {binary-file-data}
printRange string all, selectPages all
printRangeStart int {any non-zero integer}
orientation string portrait, landscape portrait
color string true, false true
duplex string true, false true
collate string true, false true
scaleToFit string true, false true
copies int {any non-zero integer} 1
pageSize string letter, A4 letter
pptOption string slides, handouts, notespages, outlineview slides
pptHandoutOptions string one, two, three, four, six, nine two
xlsOption string activesheets, entireworkbook activesheets
imagePrintSize string _4x6, _5x7, _8x10, letter letter
imageRatio string centerAndCrop, stretchToFit, keepOriginalAspectRatio stretchToFit
imageAutoRotate boolean true, false false
quickPrintKiosk string {valid kiosk name}
Example 1.4 - Upload file to a user's account using School's credentials
POST https://api.wepanow.com/resources/files/upload HTTP/1.1
Authorization: Bearer token-acquired-through-client-credentials (school credentials)

file = application/octet-stream [ file-data-here ]
authenticatedUser = farhanraja@wepanow.com

Request parameters are all same as described above, only additional parameter required is described below.

API Files Resource - Additional Parameters
Name Type Possible Values Default
authenticatedUser String email

Statushttps://api.wepanow.com/resources/files/{fileRefId}

  • GET

Checking the status files can be done in one of two ways. For a specific file, the reference ID may be passed with the same URL used for print option updates. If a reference ID is not included, all active files for the given authenticated user will be returned.

GET https://api.wepanow.com/resources/files/{fileRefId} HTTP/1.1
GET https://api.wepanow.com/resources/files/ HTTP/1.1

The generated response (as all POST/PUT requests outlined above) will include a unique file reference id and the current processing status. Print cost will be based on the user’s home group pricing model unless a quickPrintKiosk is passed in along with the request. Cost would then be based on the pricing model for that kiosk’s group.

Example 1.5 - File status response showing user's file is ready to print
{ 
   "fileRefId" : “rre123”, 
   “filename” : “Biology Notes.docx”, 
   “username” : “rreeves@wepanow.com”, 
   “status” : “READY_FOR_PRINT”*, 
   “printCost” : 1.25 
}

File status will always be one of the following values:

  • ACCEPTED
  • IN_PROCESS
  • READY_FOR_PRINT
  • READY_FOR_QUICKPRINT
  • PRINT_COMPLETE
  • FAILED
  • EXPIRED