Library Application (.NET)

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.

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.

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.

GetApplicationHostingStatusAsync

This endpoint retrieves the hosting status of a specified application and indicates the status of the application's hosted components, such as custom pages. An example use case of this endpoint is determining if the application's custom page has been redeployed and is healthy.

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.

Test case name Ingestion time Text extraction time
ArgumentException "Workspace ID must be -1" All endpoints require an admin-level context. To resolve this error, ensure that the workspace ID parameter in the path is set to -1.
ArgumentException "You must provide a valid option for the application install target." To resolve this error, ensure that at least one workspace ID is provided in the InstallApplicationAllRequest.
InvalidInputException "The RAP file provided for the Library Application is invalid." When calling Create or Update, ensure that the file sent with the request is a valid Relativity RAP file.
InvalidInputException "The workspace ID is not valid." The workspace ID passed in the request is either invalid or points to a workspace that no longer exists.
InvalidInputException "Global applications cannot be installed into a workspace." The specified application is a global application. Global applications cannot be installed into workspaces if the DeveloperMode instance setting is set to false.
InvalidInputException "You must provide at least one workspace." At least one workspace ID must be provided in the request for the attempted operation.
InvalidInputException "You must provide a valid option for the application install target." The two available application install target options are ForceInstall or UpgradeOnly.
InvalidInputException "There are already pending or in-progress installs for this Library Application." To resolve this error for the attempted operation, ensure that there are no pending or in-progress installations queued for the specified application and workspace.
InvalidInputException "The supplied installation status identifier is out of date for this application." To resolve this error, ensure that the application installation ID passed in the request represent the latest installation of that application.
InvalidInputException "The supplied installation status identifier is not valid for the specified application." The application installation ID passed in the request does not match any installation records associated with the specified application.
InvalidInputException "This value must be greater than zero." For operations that involve pagination, ensure that both the index of the first result and the number of results to return in a single page are set to a value greater than zero.
InvalidOperationException "Unknown value for InstallOutcome ..." If the system is unable to determine whether to proceed or skip queuing an application installation, the system will throw an InvalidOperationException. To resolve this error, ensure that the application has a valid version and origin signature.
NotFoundException "The object does not exist or you do not have permission to access it." As the exception message states, one or more of the objects requested (i.e. a specified workspace, a specified application, a specified application installation ID, a specified validation result ID, etc.) does not exist.
PermissionDeniedException "One or more of the objects requested do not exist or you do not have permission to access them." As the exception message states, either the objects requested (i.e. a specified workspace, a specified application, a specified application installation ID, a specified validation result ID, etc.) do not exist, or the user does not have sufficient permissions to perform the action. The most basic permissions that all users must have include the ViewAdminRepository