Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Contents
1 Introduction _________________________________________ 2
2 Using REST APIs ______________________________________ 2
2.1 URIs _________________________________________________ 2
2.2 Representations (Content Types) ______________________________ 2
2.3 Errors and Status codes ____________________________________ 3
3 Security ____________________________________________ 3
4 API Versioning _______________________________________ 3
5 Resources / APIs ______________________________________ 4
5.1 Devices List (GET /rpc/api/rest/device/1/) __________________ 4
5.1.1 Request Query Parameters ___________________________________________ 4
5.1.2 Response Data ___________________________________________________ 4
5.1.2.1 Example JSON Data ____________________________________________ 4
5.1.2.2 Example XML Data ____________________________________________ 5
5.1.3 Example URIs ___________________________________________________ 5
Revision History
Date
March 27 2014
Author
Geoff Smith
Change
Add optional address field to returned device details
Copyright 2014 PaperCut Software International Pty. Ltd., All Rights Reserved
v2014-07-01
1 Introduction
This document outlines the PaperCut Device REST Web service API that provides a simple
interface for retrieving information about the devices registered to the PaperCut application.
This is available in PaperCut MF version 10.7 or higher.
This interface is commonly used by copier vendors or third parties to provide a single-signon for embedded MFP applications. PaperCuts MFP embedded software controls access to
MFP devices by restricting access to the device until the user successfully authenticates with
PaperCut.
To provide a seamless single-sign-on experience any other MFP applications require the
details of the currently logged-in user (e.g. their username or email address). This
information is now available through this Device REST API.
If you have any questions please contact PaperCut support (support@papercut.com).
2.1 URIs
REST URIs in PaperCut take the following form:
http://server:port/rpc/api/rest/<api>/<version>
The <version> is used to indicate the version of the API.
For example the Device API URIs are located at:
http://server:port/rpc/api/rest/device/1
Requested using
Requested using one of:
application/json in the HTTP Accept header
.json file extension
XML
Copyright 2014 PaperCut Software International Pty. Ltd., All Rights Reserved
2 of 8
v2014-07-01
To request the XML representation set the Accept header to: Accept: application/xml. To
request the JSON representation set the Accept header to: Accept: application/json.
Setting the Accept header is not always convenient (e.g. when making a request with a
web browser). An alternative way to request a particular representation is to append the
.xml or the .json extensions to the request. Examples of this are given in the Example
URIs sections below.
Description
Success.
404
403
500
3 Security
Security is important to PaperCut and the device APIs can include some information that
should not be available to unauthorized users. For this reason the PaperCut Device REST
API is only accessible from a pre-defined network address / IP address. By default
PaperCut will only allow requests from localhost (or 127.0.0.1).
If a request is made to these APIs from an unauthorized address the request is denied with a
HTTP status of 403 (Forbidden).
To allow client to call these APIs from other machines, add their IP addresses to the list of
authorized addresses. To do this:
4 API Versioning
This document describes the device REST API version 1. The version number of the API is
encoded in the URI of the API (note the 1 in the API URI below).
Copyright 2014 PaperCut Software International Pty. Ltd., All Rights Reserved
3 of 8
v2014-07-01
http://server:9191/rpc/api/rest/device/1/
If there is a need to break compatibility the version number will be increased and the URI
changed to the new version. The old API version will continue to exist.
5 Resources / APIs
All PaperCut device resources are located under the following URIs, one for HTTP and the
other for HTTPS.
HTTP:
http://papercut-server:9191/rpc/api/rest/device/1
HTTPS: https://papercut-server:9192/rpc/api/rest/device/1
Description
Filters the list of devices to the list to devices of the given type.
Examples include:
SHARP_OSA For Sharp MFPs
TOSHIBA For Toshiba MFPs
COPICODE_IP For CopiCode IP terminals
serialNumber
Filters the list of devices to the device with the given serial number.
Copyright 2014 PaperCut Software International Pty. Ltd., All Rights Reserved
4 of 8
v2014-07-01
"type" : "DEVICE_TYPE",
"link" : http://server:9191/rpc/api/rest/device/1/MyDevice2
}
]
Copyright 2014 PaperCut Software International Pty. Ltd., All Rights Reserved
5 of 8
v2014-07-01
Description
The device name as it appears in the PaperCut interface
type
link
The URI that can be used to access the device resource. The URI
will be correctly URL encoded in UTF-8.
address
(optional)
serialNumber
(optional)
loggedInUser
(optional)
The device user structure describes the user that is currently logged into the device. If a
user is logged into the device this data is populated in the loggedInUser field of the device.
Parameter
username
Description
The username of the user.
fullName
(optional)
email
(optional)
cardNumber
The users full name. If not known, this field is not returned.
The users email address. If not known this field is not returned.
The users card/ID number. If not known this field is not returned.
Copyright 2014 PaperCut Software International Pty. Ltd., All Rights Reserved
6 of 8
(optional)
office
(optional)
department
(optional)
v2014-07-01
Copyright 2014 PaperCut Software International Pty. Ltd., All Rights Reserved
7 of 8
v2014-07-01
"email" : "john.smith@domain.com",
"cardNumber" : "12345",
"office" : "Administration"
"department" : "12345"
}
}
Example for a device with the minimum data populated (i.e. no logged in user):
{
"name" : "MyDevice",
"type" : "DEVICE_TYPE",
"link" : "http://server:9191/rpc/api/rest/device/1/MyDevice"
}
Copyright 2014 PaperCut Software International Pty. Ltd., All Rights Reserved
8 of 8