Integrate DWS Viewer API with your own backend
DWS Viewer API provides a programmatic API that enables 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 is language agnostic, with the only requirement being the 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, which stores the document.
- Your service receives the document ID back, which it can use to reference the document later.
- To be able to do this, it needs to persist the document ID in persistent storage — for example, a database.
Viewing a document in your web app
After you create a document via upload, you can open it via Nutrient Web SDK. Any changes made to the document are automatically persisted by DWS Viewer API.

- A user requests a document to display in your web app running in a web browser.
- Your app requests access to the document from your backend.
- Your backend creates an session token for the requested document.
- The session token is then passed to your web app.
- The web app loads Nutrient Web SDK using the session token for authentication.
- After successful authentication, it displays the document streamed from DWS Viewer API.