Integrate DWS Viewer API with Your Own Backend

DWS Viewer API provides a programmatic API that allows you to easily integrate it with your backend. This backend can be a regular server-side application running in your infrastructure or in a cloud, or it could even be a serverless function. The API as such is language agnostic, the only requirement being an ability to communicate via HTTP.

Uploading a Document to DWS Viewer API

When you create a document by upload, your backend service sends the file to DWS Viewer API, which will manage the entire document lifecycle.

Your service uploads the document to DWS Viewer API and receives a document ID back.

  1. 1
    Your service uploads the document to DWS Viewer API, which stores the document.
  2. 2
    Your service receives the document ID back, which it can use to reference the document later.
  3. 3
    To be able to do this, it needs to persist the document ID in a permanent storage — for example, a database.

Viewing a Document in Your Web App

After you create a document via upload, you can open it via the PSPDFKit for Web SDK. Any changes made to the document are automatically persisted by DWS Viewer API.

Nutrient for Web opens a document from DWS Viewer API

  1. 1
    A user requests a document to display in your web app running in a web browser.
  2. 2
    Your app requests access to the document from your backend.
  3. 3
    Your backend creates an session token for the requested document via DWS Viewer API’s API.
  4. 4
    The session token is then passed to your web app.
  5. 5
    The web app loads Nutrient for Web using the session token for authentication.
  6. 6
    After successful authentication, it displays the document streamed from DWS Viewer API.