Resource File (.NET)

The Resource File API allows clients to manage resource files for the Relativity applications in the environment. It includes the following features:

  • Supports create, read, update, delete and download resource files.
  • Update/upload file content and metadata.
  • Secondary methods allows the client to read all eligible applications.

You can also interact with the Resource File API through the REST API. See Resource File service.

Guidelines for the Resource File API

Review the following guidelines for working with the Resource File API.

Admin-level context

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

Sample use cases

The Resource File API can be used by R1 Operations or ISVs to manage third-party applications in their Relativity instances.

Endpoints

The Resource File API includes the following endpoints. To set up a proxy to interact with the IResourceFile API, call the CreateProxy() method on the object returned by the GetServiceManager() method.

CreateAsync

The following code samples illustrate how to use this endpoint to add/create new resource files in the environment.

Permissions

The following permissions are required to call this endpoint:

  • Instance - Object - Resource File - Create
  • Instance - Object - Library Application - View
  • Instance - Admin Operations - View Admin Repository

ReadAsync

The following code sample illustrate how to use this endpoint to retrieve advanced metadata for a resource file, including its name, application, and other properties.

  • IncludeMetadata - A Boolean value indicating whether to return extended resource file metadata in the response.
  • IncludeActions - A Boolean value indicating whether to return a list of operations eligible to the current user of this resource file.

Permissions

The following permissions are required to call this endpoint:

  • Instance - Object - Resource File - View
  • Instance - Admin Operations - View Admin Repository

Additional permissions are required to view the application name and consume the Edit and Delete actions:

  • Instance - Object - Resource File - Delete
  • Instance - Object - Resource File - Edit
  • Instance - Object - Library Application - View

UpdateAsync

The following code samples illustrate how to use this endpoint to allow the client to update/modify resource file metadata and file content.

Permissions

The following permissions are required to call this endpoint:

  • Instance - Object - Resource File - View
  • Instance - Object - Resource File - Edit
  • Instance - Admin Operations - View Admin Repository

The following code samples illustrate how to use this endpoint to modify properties of a resource file using a previously uploaded contents. The contents must have been previously uploaded using the UploadContentsAsync endpoint.

DeleteAsync

The following code samples illustrate how to use this endpoint to delete the Resource File.

Permissions

The following permissions are required to call this endpoint:

  • Instance - Object - Resource File - View
  • Instance - Object - Resource File - Delete
  • Instance - Admin Operations - View Admin Repository

DownloadContentsAsync

The following code samples illustrate how to use this endpoint to download the contents associated with a resource file.

Permissions

The following permissions are required to call this endpoint:

  • Instance - Object - Resource File - View
  • Instance - Admin Operations - View Admin Repository

UploadContentsAsync

The following code sample illustrate how to use this endpoint to upload the file contents. This endpoint is used in conjunction with CreateAsync and UpdateAsync to implement workflows where the file contents are uploaded before creating the resource file. The resource file is NOT created or updated until a subsequent call to CreateAsync or UpdateAsync.

Permissions

The following permissions are required to call this endpoint:

  • Instance - Object - Resource File - View
  • Instance - Admin Operations - View Admin Repository

UpsertAsync

The following code samples illustrate how to use this endpoint to create a resource file if it doesn't exist or update properties of an existing resource file. The uniqueness of a resource file is determined by the combination of Application GUID and File Name.

Permissions

The following permissions are required to call this endpoint:

  • Instance - Object - Resource File - Create
  • Instance - Object - Resource File - View
  • Instance - Object - Resource File - Edit
  • Instance - Object - Resource File - Delete
  • Instance - Object - Library Application - View
  • Instance - Admin Operations - View Admin Repository

GetEligibleApplicationsAsync

The following code sample illustrate how to use this endpoint to retrieve a list of applications that can be associated to a resource file. It is used in the Relativity UI to populate a list for the user to choose from. The values returned in the list are subject to item-level security.

Permissions

The following permissions are required to call this endpoint:

  • Instance - Object - Library Application - View
  • Instance - Admin Operations - View Admin Repository

PushResourceFiles

The Push Resource File method allows callers to upload one or more resource files using local file paths.