Document Viewer Services in REST

The Document Viewer Services API provides an HTTP service, which you can use to request document conversions through Representational State Transfer (REST). The Document Viewer Services API provides functionality for requesting the conversion of documents to viewer types supported by Relativity, such as native, image, production, and transcript types. You can also convert files contained in File fields on a Relativity Dynamic Objects (RDOs). These files are converted to their native format on the fly, and then displayed in the standalone viewer.

Relativity performs the conversion and then stores the content in the converted cache table for a specific workspace. After a document is converted to a specified type, you can then display it in the viewer available through the Relativity UI. For more information, see Viewer on the RelativityOne Documentation site.

The Document Viewer Services API also allows you to view information about persistent highlight sets and terms in a specific document and workspace through REST. Persistent highlight sets allow you to configure and apply term highlighting to assist with document review in the Viewer. To learn more, visit Persistent highlight sets.

The Document Viewer Services API also provides functionality for persistent highlight sets and allows you to view information about the persistent highlight sets and terms in a specific document and workspace through REST. The API also allows you to select the default highlight sets or terms as well as make any terms or sets inactive. Persistent highlight sets allow you to configure and apply term highlighting to assist with document review in the Viewer. To learn more, visit Persistent highlight sets.

The following sample use cases illustrate how you can use these cache entries to create custom viewers or workflows for displaying documents:

You can also use the Document Viewer Services through .NET. For more information, see Document Viewer Services API.

This page contains the following information:

Client code samples

To use the Document Viewer Services, send an HTTP request that makes a POST method call. See the following RL for this service:

<host>Relativity.REST/api/Relativity.DocumentViewer.Services.IDocumentViewerServiceModule/DocumentViewerServiceManager/GetViewerContentKeyAsync/

The GetViewerContentKeyAsync endpoint supports different conversion types and priorities. You can use the following .NET code samples as REST clients for requesting conversions. They illustrate how to perform conversions for native formats, productions, and images with various priorities. Additionally, they all perform the following common tasks:

Convert documents

To convert documents in a workspace, send a request to this URL for the Document Viewer Services:

<host>Relativity.REST/api/Relativity.DocumentViewer.Services.IDocumentViewerServiceModule/DocumentViewerServiceManager/GetViewerContentKeyAsync/

JSON requests

The following fields on the request object are required unless specifically identified as optional:

Sample JSON for native format request

{
   "request":{
      "WorkspaceId":1015349,
      "ConversionType":"Native",
      "DocumentIds":[
         1015350
      ],
      "Priority":"OnTheFly",
      "Options":{
         "ClientId":"Relativity.Documentation.Sample"
      }
   }
}

Sample JSON for a production request

{
   "request":{
      "WorkspaceId":1015349,
      "ConversionType":"Production",
      "DocumentIds":[
         1015350,
         1015351,
         1015352
      ],
      "Priority":"ConvertAhead",
      "Options":{
         "ProductionID":1015123,
         "ForceConversion":false,
         "ClientId":"Relativity.Documentation.Sample"
      }
   }
}

Sample JSON request for a mass conversion of images

{
   "request":{
      "WorkspaceId":1015349,
      "ConversionType":"image",
      "Priority":"MassConvert",
      "Options":{
         "DocumentSetId":"c10478fc-b30e-4e13-a68b-d388938ef3b4",
         "ForceConversion":true,
         "ClientId":"Relativity.Documentation.Sample"
      }
   }
}

JSON responses

A conversion response includes a ViewerContentKey object. This object may contain the DocumentArtifactId, CacheEntryId, ConversionVersion, and RequestKey fields. For more information, see Document Viewer Services API.

If the document currently undergoing conversion, the JSON response contains the following fields:

{
   "RequestKey":"180eab41-2af8-48b6-b098-cb8746c140ea",
   "DocumentArtifactId":1015350
}

If the conversion of a document has completed, the JSON response contains the following fields:

{  
   "DocumentArtifactId":1015350,
   "CacheEntryId":40918,
   "ConversionVersion":"2017.3.3.13"
}

Convert files contained in File fields on RDOs

You can convert a file contained in a File field on a Relativity Dynamic Object (RDO) for display in the standalone viewer. This file is converted to its native format. Similar to document conversion, this process uses the GetViewerContentKeyAsync endpoint. Send a request to this URL for the Document Viewer Services:

<host>Relativity.REST/api/Relativity.DocumentViewer.Services.IDocumentViewerServiceModule/DocumentViewerServiceManager/GetViewerContentKeyAsync/

The following fields on the request object are required unless specifically identified as optional:

{
   "request":{
      "WorkspaceId":1018492,
      "DocumentIds":[
         1038275
      ],
      "ConversionType":"Native",
      "Priority":"OnTheFly",
      "Options":{
         "ForceConversion":false,
         "FileId":1
      }
   }
}

The JSON responses for converting File fields contain the same fields as those returned for document conversion. For more information, see JSON responses.

Get persistent highlight sets in a specific document and workspace

Persistent Highlight Sets Manager allows you to view all persistent highlight sets and terms within a specified document and workspace.

To see the persistent highlight sets, send a GET request to the following URL:

Relativity.REST/api/Relativity.DocumentViewer.Services.IDocumentViewerServiceModule/PersistentHighlightServiceManager/GetPersistentHighlightSets/<workspaceId>/<documentid>

Change persistent highlight set state

Persistent Highlight Sets Manager allows you to change the default persistent highlight set or terms. Additionally, you can make terms or sets inactive as desired.

To change the state of persistent highlight sets, send a GET request to the following URL:

Relativity.REST/api/Relativity.DocumentViewer.Services.IDocumentViewerServiceModule/PersistentHighlightServiceManager/SavePersistentHighlightSetState

Community Updates

Aero Developer FAQ Evolving the Platform Most recent release notes
Learn more Learn more Learn more

Additional Resources

   
Access Third-Party Tools with GitHub     Create .NET Apps Faster with NuGet
Visit github     visit nuget