Library Application API

The Library Application API allows clients to read application metadata and RAP files from the library, upload new applications, and update or delete existing applications.

You can also interact with the Library Application API through the REST API. See Library Application service.

This page contains the following information:

Guidelines for the Library Application API

Review the following guidelines for working with the Library Application API.

Admin-level context

The value for the workspaceID parameter in the path should always be -1. Any other value will return an error.

Permissions

For all endpoints in the ILibraryApplication API, except ReadAsync, users are required to be system administrators in order to have sufficient permissions.

Sample use cases

The Library Application API can be used by R1 Operations or ISVs to manage third-party applications in their Relativity instances. For example, a provisioning pipeline may update a new environment with supported third-party applications. Note that this API can be used in conjunction with the Application Install API.

Endpoints

The Library Application API includes the following endpoints. To set up a proxy to interact with the ILibraryApplication API, call the CreateProxy() method on the object returned by the GetServiceManager() method. (For more information, check out Best Practices for the Services API.)

CreateAsync

The following code samples illustrate how to create a library application using the CreateAsync() method of the ILibraryApplicationManager interface.

ReadAsync

The following code samples illustrate how to retrieve the metadata for an application in the library using the ReadAsync() methods of the ILibraryApplicationManager interface.

ReadAllAsync

The following code samples illustrate how to retrieve the metadata for all applications in the library using the ReadAllAsync() methods of the ILibraryApplicationManager interface.

ReadApplicationContentsAsync

The following code samples illustrate how to retrieve the RAP file for an application in the library using the ReadApplicationContentsAsync() methods of the ILibraryApplicationManager interface.

UpdateAsync

The following code samples illustrate how to update the Application Library using the UpdateAsync() method of the ILibraryApplicationManager interface.

Note: If CreateIfMissing= true and an application with a matching Guid already exists, then it will be updated. If no application exists with the Guid, a new application will be created. If CreateIfMissing= false and an application with a matching Guid already exists, then it will be updated. If no application exists with the Guid, an error will occur.

DeleteAsync

The following code samples illustrate how to delete an application from the Application Library using the DeleteAsync() method of the ILibraryApplicationManager interface.

GetLibraryInstallStatusAsync

The following code samples illustrate how to get status information about the most recent install to the Application Library for the specified application using the GetLibraryInstallStatusAsync() method of the ILibraryApplicationManager interface. This endpoint allows clients to query for the status of an update to the application library. A status of Completed indicates the application was created or updated successfully and is ready to be installed into one or more workspaces. A status of Failed indicates a problem with the installation. Once the issue has been resolved, clients can invoke RetryLibraryInstallAsync to retry the library installation.

RetryLibraryInstallAsync

This endpoint allows clients to retry a failed library installation for an application. Library installations are initiated when a new application is added to the library or an existing application is updated. Sometimes they can fail, and the application cannot be installed into any workspaces until the failure is resolved. The following code samples illustrate how to retry a failed application install for an application using the RetryLibraryInstallAsync() method of the ILibraryApplicationManager interface.

CancelLibraryInstallAsync

This endpoint cancels the pending library installation for the specified application. If the installation is already in progress or complete, the operation response will indicate an unsuccessful cancellation with a message explaining why.The following code samples illustrate how to cancel the pending library install for a specified application using the CancelLibraryInstallAsync() method of the ILibraryApplicationManager interface.

UploadPackageAsync

This endpoint uploads a RAP or XML file to a temporary location in Relativity and returns a unique file identifier along with the metadata for the application. If the file is not in a valid format, a validation exception is thrown. This endpoint is used in conjunction with CreateAsync and UpdateAsync to implement workflows where an application's details need to be displayed first for final confirmation before actually installing the application.

DownloadPackageAsync

This endpoint downloads a RAP or XML file previously uploaded using the UploadPackageAsync endpoint. It takes the unique file identifier as an argument in the URL path and returns a stream of bytes.

DeletePackageAsync

This endpoint allows clients to delete an RAP file that has been uploaded to a temporary storage location.

Workflow-Based code samples

For more information on how the Application Install API and Library Application API endpoints can be used together, see Workflow-Based code samples.