Document File Manager service

Through the REST API, the Document File Manager API exposes endpoints for downloading native, image, and produced image files associated with documents in Relativity. You can download a file by specifying its GUID, or you can download a native file by specifying the Artifact ID of the document associated with it. The Document File Manager API also supports retrieving information about these files, such as GUID, name, type, size, and others.

Sample use cases for the Document File Manager API include the implementing the following functionality:

The Document File Manager API supports the same functionality for this service as available through the REST API. For more information, see Document File Manager API.

This page contains the following information:

Client code sample

To use the Document File Manager service, send requests by making calls with the required HTTP methods. See the following base URL for this service:

<host>/Relativity.REST/api/Relativity.Document/workspace/{{workspaceID}}/

You can use the following .NET code as a sample client for downloading a native file. This code illustrates how to perform the following tasks:

public static async Task DownloadAndSaveFileHttpExample()
{
    using (HttpClient client = new HttpClient())
    {
        client.DefaultRequestHeaders.Add("X-CSRF-Header", "-");
        client.DefaultRequestHeaders.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1").GetBytes("test@test.com:SomePassword!")));
        client.DefaultRequestHeaders.Add("X-Kepler-Version", "2.0");
        client.BaseAddress = new Uri("https://localhost");

        int workspaceId = 1016883;
        int documentArtifactId = 1038029;

        string url = $"/Relativity.REST/api/Relativity.Document/workspace/{workspaceId}/downloadnativefile/{documentArtifactId}";
        using (HttpResponseMessage response = await client.GetAsync(url))
        {
            response.EnsureSuccessStatusCode();
            using (Stream responseStream = await response.Content.ReadAsStreamAsync())
            using (Stream fileStream = File.Create($"C:\\RelativityDocuments\\{(response.Content.Headers.ContentDisposition.FileName).Replace("\"", "")}"))
            {
                await responseStream.CopyToAsync(fileStream);
            }
        }
    }
}

Retrieve document file information

You can retrieve information about the files associated with a document, including the file name, GUID, page orientation and others.

Note: To retrieve the file information for a document, you must have rights to view it in the workspace. Additionally, you must have access rights to view a production for its associated files to be include in the results.

Send a GET request using the following URL format:

<host>/Relativity.REST/api/Relativity.Document/workspace/{{workspaceID}}/fileinfo/{{documentID}}

Set the {{workspaceID}} to the Artifact ID of the workspace containing the document, and the {{documentID}} to the Artifact ID of the document. See the following sample URL:

<host>/Relativity.REST/api/Relativity.Document/workspace/1016883/fileinfo/1038018

The body of the request is empty.

The response contains an array of the DocumentFile objects. Each object has the following fields:

[
  {
    "Guid": "d52141e9-8144-47af-b2f9-635045c313fc",
    "Filename": "MyDocument.docx",
    "Order": 0,
    "FileType": "Native",
    "Size": 20912,
    "Rotation": "NotSet"
  },
  {
    "Guid": "e03a9a5f-e398-46b2-a7d0-4c3ec1cd4541",
    "Filename": "MyDocument.tif",
    "Order": 0,
    "FileType": "OriginalImage",
    "Size": 944,
    "Rotation": "NinentyDegrees"
  },
  {
    "Guid": "21d33e10-6034-468e-ac2d-7f57c16e589f",
    "Filename": "MyDocument_001.tif",
    "Order": 1,
    "FileType": "OriginalImage",
    "Size": 650,
    "Rotation": "TwoHundredSeventyDegrees"
  }
]

Download files

You can download native, image, and produced image files associated with documents in Relativity using the following endpoints:

These endpoints return the binary data of a file. The response contains these headers with the following settings:

Note: For native and image files, you must have rights to the document in the workspace. For produced image files, you must have rights to both the document and the production that includes the produced images.

Download a file by GUID

You can download a native, image, or produced image file by specifying its GUID in a call to the DownloadFile endpoint. To obtain the GUID of a file for download, use the GetFileInfo endpoint. See Retrieve document file information.

Send a GET request using the following URL format:

<host>/Relativity.REST/api/Relativity.Document/workspace/{{workspaceID}}/downloadfile/{{fileGuid}}

Set the {{workspaceID}} to the Artifact ID of the workspace containing the document, and the {{fileGuid}} to the GUID for the file. See the following sample URL:

<host>/Relativity.REST/api/Relativity.Document/workspace/1016883/downloadfile/d6d94ed0-c46b-427d-b702-2682f1e43cf5

When the request is successful, the response returns the status code of 200, and the file is saved to disk using the file name specified in the Content-Disposition header.

Download a native file by Document Artifact ID

You can download a native file by specifying the Artifact ID of the document associated with it. This convenience endpoint functions similarly to calling the DownloadFile endpoint with the GUID for a native file, except that you specify the Artifact ID of a document.

Send a GET request using the following URL format:

<host>/Relativity.REST/api/Relativity.Document/workspace/{{workspaceID}}/downloadnativefile/{{documentID}}

Set the {{workspaceID}} to the Artifact ID of the workspace containing the document, and the {{documentID}} to the Artifact ID of the document. See the following sample URL:

<host>/Relativity.REST/api/Relativity.Document/workspace/1016883/downloadnativefile/1038018

When the request is successful, the response returns the status code of 200, and the file is saved to disk using the file name specified in the Content-Disposition header.

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