The Universal API is an abstraction layer over different storage backends, also known as persistences. This abstraction supports legal and business processes with documents functionality regardless of where or how the document is actually stored.
Persistences
A persistence is the storage backend for documents. It enables storage agnostic processes and integrations.
In a tenant each persistence type can only be used once.
A tenant-wide default setting determines which persistence is used. Applications can use access different persistences explicitly per request.
Not all persistences support the same functionalities. The following table explains what capabilities the individual persistences support.
Capability | CloudStore | OnPremise |
---|---|---|
Installable Prerequisites | - | STP.Documents.OnPremise + STP.Documents.OnPremiseAgent (same for Mobile DESK) |
User authentication | ✅ requesting party access token is passed along and validated just as if the requestor accessed the CloudStore directly | ⚠️ only users with XID (synced from OnPremise UM) and activated device key can make requests; requesting party access token is passed along and validated just as if the requestor accessed the Channel.OnPremise directly |
User-less requests | ⚠️ only get contexts, resolve by context, get metadata, download renditions, upload renditions | ✅ via agent user (since agent v1.10.10) |
Determine availability | ✅ | ✅ |
Broadcast NewDocumentEvent | ✅ | ✅ (since agent v1.10.8; ⚠️ without UserId) |
Broadcast NewDocumentVersionEvent | ✅ | ✅ (since agent v1.10.8) |
Broadcast DocumentMetadataChangedEvent | ✅ | ✅ (since agent v1.10.8) |
Broadcast DocumentPermanentlyDeletedEvent | ✅ | ✅ (since agent v1.12.0) |
Upload new document | ✅ | ✅ |
Max upload size | 1TB | 50MB |
Upload with external ID | ⛔ | ⛔ |
Upload new version | ⛔ | ⛔ |
Upload custom rendition | ✅ | ✅ (since agent v1.10.32 and DMS onpremise v8.4.31) |
Min custom rendition size | 0B | 0B |
Get document metadata | ✅ | ✅ (⚠️ without UserId) |
Get version metadata | ✅ | ✅ (⚠️ without UserId) |
List version history | ✅ | ✅ (⚠️ without UserId) |
Download latest version | ✅ | ✅ |
Download specific version | ✅ | ✅ |
Version number | int32 | int16 |
List renditions | ✅ | ✅ |
Download rendition | ✅ | ✅ |
Max download size | unlimited | 100MB |
Delete document (soft delete) | ✅ | ✅ (since agent v1.12.0) |
Delete document permanently | ⛔ | ⛔ |
Delete version | ⛔ | ⛔ |
Delete rendition (permanently) | ✅ | ✅ |
Search document by title | ⛔ | ⛔ |
Search document by external ID | ⛔ | ⛔ |
Search document by content | ⛔ | ⛔ |
Find contexts | ✅ | ✅ |
Connect contexts during upload | ✅ | ✅ |
Connect multiple contexts of same type | ✅ | ⛔ |
Connect contexts after upload | ✅ | ✅ |
Set contexts (overwriting not-specified) | ✅ | ✅ |
Disconnect contexts | ⛔ | ⛔ |
Supported context types | ||
Resolve by context | ✅ | ✅ |
Resolve by composite context (UNION/INTERSECTION of multiple contexts) | ✅ | ⚠️ the following combinations are currently not supported: |
Create context | ✅ | ⛔ |
Read context | ✅ | ✅ |
Update context | ⛔ | ⛔ |
Delete context | ⛔ | ⛔ |
Label document with a named value | ✅ | ⚠️ no concurrency check, last writer wins; stp.doc.class supported since agent v1.11.1 and DMS onpremise v8.5.7; only stp.doc.class triggers a metadata changed event |
Inbox (cursor-based loading) | ✅ | ⛔ |
The Universal API provides document capabilities across supported archives or persistences. Not all persistences are equal. There are schematic and behavioral differences between them. Some are minor (different length of version numbers) but others are major (e.g. categories dont have an ID and only a name). Given these differences, the Universal API strives to offer a harmonized facade for all supported persistences.
We strive to support the greatest common denominator where it makes sense. We dont let outliar differences dictate the overall standard of the Universal API. We accept that certain persistences might not support all capabilities to the fullest. We expect the adapters of these persistences to reconcile differences to the best of their abilities and throw exceptions where they cannot. We accept that these persistences behave differently at runtime.
It becomes easier to
- establish a standard of document capabilities, because we are not limited by the weakest supported persistence
- use best practices, because they benefit the majorify of persistences.
It becomes more difficult to
- predict runtime behavior, because depending on the configured persistence, the APIs might behave differently (we could mitigate this with a limitations API in the future)
- write universal code, because more exception handling has to be implemented.
Contexts
Contexts provide metadata-based grouping of documents. Documents can be associated to a context. Contexts are for example case/matter, legal category, or participant.
Other applications dealing with documents are responsible to maintain context representations of their container objects within STP.Documents.
The availability of context types is determined by the used
persistence. We assume that all supported persistences have at least one
context type comparable to a “matter” (stp.doc.matter
).
Versions
Each document maintains a version history. A version captures the state of a document’s content (including renditions) at a specific point in time.
The latest version reflects the most current state.
All versions are ordered chronologically.
Renditions
A rendition is a representation of a document version, such as:
stp.doc.original – the original content
stp.doc.preview – a display-ready preview
Applications can define custom renditions. They can be read by all applications, but written or deleted only by the creating application.
Named Values
Named values attach additional metadata either to the entire document or a specific version. These values can be used as custom annotations, flags, or auxiliary data.
Events
Changes in the persistences can be observed via events (e.g. document uploaded, version updated, etc.). Other STP applications can subscribe to these events.
APIs
The Universal API consists of multiple APIs. Details about their endpoints can be found in these Open API specifications:
For dotnet we also provide the STP.Documents.Client
nuget package via our private technology partner nuget feed at STP.TechnologyPartner.
Learn more about working
with the NuGet registry.
Example code can be found at STP.Documents.Example.
How to get started building?
To access STP Cloud APIs, you need to register your application with us. This will allow your application to acquire access and refresh tokens to access STP Cloud APIs on your users behalf.
Please contact us at support@stp.one to initiate your application registration. Please provide details about what kind of application you are building and how it simplifies your users’ legal work. During the onboarding process you will also need to accept our technology partner agreement.
Afterwards you will get access to our private technology partner nuget feed at STP.TechnologyPartner, where you can find all our packages.
Please note that Documents customers must first be activated and enter into an additional licence and usage agreement before they can use the API with your product. Alternatively, you can apply to become a Marketplace Partner and make your solution available to all Documents customers under a cooperation agreement.