TX Text Control .NET Server

REST API

Topic

TX Text Control .NET Server doesn't come with a REST API of its own. It is a set of .NET components that your application calls in its own process, and when other systems need documents over HTTP, your ASP.NET Core application provides the endpoints. The sections below sort out the HTTP endpoints you meet with the product: the ones the browser components add for themselves, the one you write to receive signed documents, the Web API you build and the ready-made Web API of DS Server.

Endpoints the Components Add

The Document Editor and the Document Viewer run in the browser and talk to your ASP.NET Core application. The packages add the endpoints they need to the request pipeline of your application. They serve the components, and no source documents them as an API for your own code.

ComponentAdded in Program.cs byWhat it provides
Document Editorapp.UseTXWebSocketMiddleware() from TXTextControl.WebA WebSocket endpoint, /api/TXWebSocket in the tutorials, that forwards the editor's connection to the backend worker, and the editor script at GetResource?name=tx-document-editor.min.js below it
Document ViewerThe package itself in an MVC application, or app.UseTXDocumentViewer() in applications without views; the package is TXTextControl.Web.DocumentViewer, or TXTextControl.Web.DocumentViewer.Classic for the Classic engineThe requests of the viewer below /TextControl/, such as its script at /TextControl/GetResource?Resource=minimized.tx-viewer.min.js

The Document Editor connects with WebSocket, not with REST calls: Architecture and WebSocket Architecture describe the connection. Document Viewer with ASP.NET Core shows how the viewer's backend is set up.

The Endpoint That Receives Signatures

The one endpoint of the Document Viewer that your code implements is the target of a signature. When a user has signed a document, the viewer's controller sends an HTTP POST request with a SignatureData object in its body to the URL in RedirectUrlAfterSignature. Your controller action receives the object and stores or processes the signed document.

Digital Signatures builds this endpoint, and Digital Signatures in the Security section protects it.

Build Your Own REST API

A document service that other applications call is an ASP.NET Core Web API with controllers or minimal API endpoints, in which ServerTextControl loads, creates and saves documents and MailMerge merges templates with data. You decide the routes, the request and response formats, the authentication and how long-running jobs are handled.

REST Services builds such a service step by step: a merge endpoint, clients in .NET and JavaScript, error responses and security. The endpoints need only the engine package, TXTextControl.TextControl.Core.SDK.

The Web API of DS Server

DS Server is a separate Text Control product, built on the same document engine, that provides document processing as a ready-to-use Web API with OAuth authentication. Its endpoints fall into four groups:

GroupWhat the endpoints do
Document processingConvert, merge and append documents, find and replace text, create thumbnails, read document information, create PDF documents, read embedded files, metadata and AcroForm fields, and create barcodes
OAuthAuthorize clients and issue access tokens
AdministrationManage users and security profiles
LicensingRegister, validate and unregister the license of the server

The Web API reference of DS Server documents each endpoint with its parameters, payloads and errors. Whether to build the service with TX Text Control .NET Server or to run DS Server is a product decision; Introduction compares the two.