Resource File (REST)

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

  • Create, read, update, delete, and download of resource files.
  • Update and upload of file content and metadata.
  • Helper services for the client, including retrieving all available applications.

Guidelines for the Resource File service

Review the following guidelines for working with this service.

URLs

  • The URLs for REST endpoints contain path parameters that you need to set before making a call:
    • Set the {versionNumber} placeholder to the version of the REST API that you want to use, using the format lowercase v and the version number, for example v1.
    • Set other path parameters in the URLs to the Artifact ID of a given entity, for example setting {workspaceID} to the Artifact ID of a workspace.
    • To indicate the admin-level context, set the {workspaceID} path parameter to -1.
  • Ensure that the X-CSRF-Header is set.

For example, you can use the following URL to retrieve a resource file:

Copy
<host>/relativity.rest/api/relativity-environment/{versionNumber}/workspaces/-1/resource-files/{resourceFileID}

Set the path parameters as follows:

  • {versionNumber} to the version of the API, such as v1.
  • {resourceFileID} to the Artifact ID of a specific resource file.

Client code sample

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

Copy
<host>/Relativity.REST/API/relativity-environment/{versionNumber}/workspaces/-1/resource-files/{applicationID}/

Create a resource file

To create a resource file, send a POST request with a URL in the following format:

Copy
<host>/relativity.rest/api/relativity-environment/{versionNumber}/workspaces/-1/resource-files

The newly created artifact ID of the resource file will be returned in the response.

Read a resouce file

To read a resource sile, send a POST request with a URL in one of the following formats:

Copy
<host>/relativity.rest/api/relativity-environment/{versionNumber}/workspaces/-1/resource-files/{resourceFileID}
<host>/relativity.rest/api/relativity-environment/{versionNumber}/workspaces/-1/resource-files/{resourceFileID}/{includeMetadata}/{IncludeActions}

Update a resource file

To read a resource sile, send a POST request with a URL in one of the following formats:

Copy
<host>/relativity.rest/api/relativity-environment/{versionNumber}/workspaces/-1/resource-files/{resourceFileID}
<host>/relativity.rest/api/relativity-environment/{versionNumber}/workspaces/-1/resource-files/{resourceFileID}/contents/{contentsKey}

Delete a resource file

To delete a resource file, send a DELETE request with a URL in the following format:

Copy
<host>/relativity.rest/api/relativity-environment/{versionNumber}/workspaces/-1/resource-files/{resourceFileID}

Download the contents of a resource file

To downloads the contents associated with a resource file, send a GET request with a URL in the following format:

Copy
<host>/relativity.rest/api/relativity-environment/{versionNumber}/workspaces/-1/resource-files/{resourceFileID}/contents/

Upload the contents of a resource file

To upload the contents associated with a resource file, send a POST request with a URL in the following format:

Copy
<host>/relativity.rest/api/relativity-environment/{versionNumber}/workspaces/-1/resource-files/contents/

Create or update a resource file

To create or update a resource file, send a PATCH request with a URL in the following format:

Copy
<host>/relativity.rest/api/relativity-environment/{versionNumber}/workspaces/-1/resource-files/

Retrieve available applications

To retrieve a list of eligible applications, send a GET request with a URL in the following format:

Copy
<host>/Relativity.REST/api/relativity-environment/{versionNumber}/workspaces/-1/resource-files/eligible-applications