REST Web Services
webPDF provides its interfaces as REST web services in accordance with JSR 311 (Java Specification Request), JSR 339 and JSR 370. This manner of provision is based on the web standards and the HTTP protocol.
The webPDF functions are provided as REST (Representational State Transfer) resources and can be addressed via a Uniform Resource Identifier (URI). The resources are displayed in JSON.
The webPDF server provides the REST web services on the basis of the Jakarta RESTful WebServices 3.1 and the Jersey 3.1.x reference implementation.
The different URIs of the web services can be executed via the default HTTP request methods.
All together this forms the webPDF REST API, which is generally described under "REST Webservice API" and technically under "API {REST}".
Documentation as OpenAPI
The documentation is provided automatically as OpenAPI. For automated processing or import into developer tools or frameworks, it can also be retrieved directly as a JSON or YAML structure:
URI of the web services
All URI have the shared base URL
/webPDF/rest
After this comes the URL segment for the respective web service, followed by further segments which are specific to the web service. An overview of the web services provided with their base URI is shown below:
| Web service | URI | API documentation |
|---|---|---|
| Converter | /webPDF/rest/converter/... | API {REST} |
| Signature | /webPDF/rest/signature/... | API {REST} |
| Pdfa | /webPDF/rest/pdfa/... | API {REST} |
| Toolbox | /webPDF/rest/toolbox/... | API {REST} |
| URLConverter | /webPDF/rest/urlconverter/... | API {REST} |
| OCR | /webPDF/rest/ocr/... | API {REST} |
| Barcode | /webPDF/rest/barcode/... | API {REST} |
Apart from these, there are three URIs for document managment ("documents” web service), authorization ("authentication” web service) and server administration.
Web service call examples
Converts the document with ID 2f32abfc05594f42bb89128a4052817d to a PDF document using the Converter web service
POST http://localhost:8080/webPDF/rest/converter/2f32abfc05594f42bb89128a4052817d
Reads the information for the currently logged in user.
GET http://localhost:8080/webPDF/rest/authentication/user/info
Reads the list of files that are currently served for the session on the server.
GET http://localhost:8080/webPDF/rest/documents/list
Content-Type header for parameters
For the REST web services, the parameters are passed in JSON structures found in the request’s "Request Body" (e.g., POST).
When calling a REST web services endpoint, set the Content-Type header to the application/json value.