Getting started

Import Service is built as a standard Relativity Kepler Service. It provides sets of endpoints that must be called sequentially in order to execute an import.

On GitHub, you can find can comprehensive samples illustrating how to import native documents, images, objects, and productions. For additional code samples, see the Import API samples repository.

Prerequisites

Please have the following actions completed before using the Import Service API:

  1. Ensure the following Relativity applications are installed:

    Application name Application Guid Installed
    Import 21F65FDC-3016-4F2B-9698-DE151A6186A2 workspace
    DataTransfer.Legacy 9f9d45ff-5dcd-462d-996d-b9033ea8cfce instance
  2. Ensure the appropriate user permissions are set.
  3. Place the load and source files, such as native documents, images, and text files, in the destination fileshare location accessible to the workspace. You can use the Transfer API to upload all files to the destination location.
  4. Install the following packages in the client application:
  5. Required only when Kepler .NET client is used.

    • Relativity.Import.SDK— a .NET library that contains Kepler interfaces for import services. It provides and simplifies executing imports in client application. Relativity.Import.SDK targets .NET Framework 4.6.2

      Use this package when your application uses Kepler.

    • Relativity.Import.Models.SDK— added automatically as dependency to Relativity.Import.SDK. .NET library contains contract models for API and builders which helps users prepare payloads in correct and consistent way. Relativity.Import.Models.SDK targets .NET Standard 2.0. The NuGet package also includes direct targets for .NET Framework 4.6.2.

      You can install this package directly if your application does not use Kepler.

    • Relativity.Kepler.Client.SDK— added automatically as dependency to Relativity.Import.SDK.

Authorization

The following section describes the authentication methods available for the Import Service API:

HTTP clients— Import Service API conforms to the same authentication rules as other Relativity REST APIs. For more information, see REST API authentication.

Kepler .NET client— the Kepler framework uses a proxy to handle client requests. For more information, see Proxies and authentication.

Permissions

The following permissions are required to use import features provided in Import Service API.

Object Security section Permission
Document View, Add, Edit
Relativity Import Job View, Add, Edit
Relativity Import datasource View, Add, Edit
Tab Visibility
Documents
Admin Operation
Allow Import

Make calls to import service

The following section outlines how to make calls to Import Service API.

HTTP clients

You can make calls to a import service using any standard REST or HTTP client. All Keplers APIs are exposed over the HTTP protocol, you need to set the required X-CSRF-Header. For more information, see Client-side interactions with a Kepler service.

Copy
HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Add("X-CSRF-Header", "-");

    createImportJobUri = $"{host}/Relativity.REST/api/import.service/v1....
    
    var response = await httpClient.PostAsJsonAsync(createImportJobUri, payload);

If using .NET client, the Relativity.Import.Models.SDK package containing contract models would be used.

For additional code samples, see Import Service API samples.

Kepler .NET client

You can access Kepler service from any .NET language using the client library provided as part of the Kepler framework. It exposes a factory class that you can use to create the client proxy by passing URLs to import services and credentials. Then use .NET proxy to interact with a import service as a set of .NET objects. When you call a member method, the proxy makes a corresponding HTTP request to the respective service endpoint. For more information, see Client-side interactions with a Kepler service.

Kepler contract for import service are exposed in Relativity.Import.SDK package.

Copy
using (Relativity.Import.V1.Services.IImportJobController importJobController =_serviceFactory.CreateProxy<Relativity.Import.V1.Services.IImportJobController>())
    {
        // Create import job.
        Response response = await importJobController.CreateAsync(
            importJobID: importId,
            workspaceID: workspaceId,
            applicationName: "Import-service-sample-app",
            correlationID: "Sample-job-0001");
        }
    }

For additional code samples, see Import Service API samples.