View Manager (REST)

You can use the View Manager service to create, read, and update Relativity views through REST. It also includes helper endpoints for retrieving the following information:

  • A user's permissions on a view and the fields used in the search conditions on the view.
  • A list of workspace users who can be assigned ownership of a view.
  • A list of object types in a workspace. When creating a view, you can use this list to assign an object type to a view based on the objects that you want displayed in it.

As a sample use case, you could use the View Manager API to add or modify views used in a custom application or through the Relativity UI. For example, you might want to create a view that uses a specific set of search criteria to display custom objects in an application.

You can also use the View Manager service through .NET. For more information, see View Manager (.NET).

This page contains the following information:

Guidelines for the View Manager 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 {versionNumber} to the version of the API, using the format lowercase v and the version number, such as v1.
  • Set other path parameters in the URLs to the Artifact ID of a given entity, such as {workspaceID} to the Artifact ID of a workspace.
  • Note: To indicate the admin-level context, set the {workspaceID} path parameter to -1.

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

<host>/Relativity.Rest/API/relativity-data-visualization/{versionNumber}/workspaces/{workspaceID}/views/{viewID}

Set the path parameters as follows:

  • {versionNumber} to the version of the API, such as v1.
  • {workspaceID} to the Artifact ID of the workspace that contains the view.
  • {viewID} to the Artifact ID of a specific view.

Postman sample file

You can use the Postman sample file to become familiar with making calls to endpoints on the View Manager service. To download the sample file, click View Manager Postman file.

To get started with Postman, complete these steps:

  1. Obtain access to a Relativity environment. You need a username and password to make calls to your environment.
  2. Install Postman.
  3. Import the Postman sample file for the service. For more information, see Working with data files on the Postman web site.
  4. Select an endpoint. Update the URL with the domain for your Relativity environment and any other variables.
  5. In the Authorization tab, set the Type to Basic Auth, enter your Relativity credentials, and click Update Request.
  6. See the following sections on this page for more information on setting required fields for a request.
  7. Click Send to make a request.

Client code sample

To use the View Manager service, send requests by making calls with the required HTTP methods. You can use the following .NET code as a sample client for making calls with the View Manager service. This code illustrates how to perform the following tasks:

  • Instantiate an HttpClient object for sending requests and responses using the URL for the View Manager service.
  • Set the required headers for the request.
  • Set the string represented by inputJSON variable to the JSON input required for your operation.
  • Set the url variable to the URL for the operation that you want to perform. This example creates a view.
  • Use the PostAsync() method to send a post request.
  • Return the results of the request.

Create a view

To create a new view, send a POST request to a URL with the following format:

<host>/Relativity.Rest/API/relativity-data-visualization/{versionNumber}/workspaces/{workspaceID}/views

The response contains the Artifact ID of the newly created view.

Retrieve information about a view

To retrieve the properties of a view, send a GET request to a URL with the following format:

<host>/Relativity.Rest/API/relativity-data-visualization/{versionNumber}/workspaces/{workspaceID}/views/{viewID}

The body of the request is empty.

Update a view

To modify the properties of a view, send a PUT request to a URL with the following format:

<host>/Relativity.Rest/API/relativity-data-visualization/{versionNumber}/workspaces/{workspaceID}/views

The response for an update operation contains the same fields as those for a read response. See the field descriptions for the response in Retrieve information about a view.

Retrieve the access status of a user

To retrieve a list of users with View permissions to a view and the fields used in the criteria for the search conditions on it, send a GET request to a URL with the following format:

<host>/Relativity.Rest/API/relativity-data-visualization/{versionNumber}/workspaces/{workspaceID}/views/{viewID}/access-status 

The request body is empty.

The response returns the following fields:

  • Exists - a Boolean value indicating whether the specified view exists.
  • CanView - a Boolean value indicating whether a user has View permissions on the specified view. For more information, see Security and permissions on the Relativity 9.6 Documentation site.
  • CanViewCriteriaFields - a Boolean value indicating whether a user has View permissions on all fields used in the criteria for a search conditions on the view.
{
 "Exists": true,
 "CanView": true,
 "CanViewCriteriaFields": true
}

Retrieve users for view ownership

You can retrieve a list of users eligible to be view owners in a specific workspace. You can then use this list to assign owners to a view. To be designated as an owner, a user must have View permissions for views. For more information, see Security and Permissions on the RelativityOne Documentation site.

Send a GET request to a URL with the following format:

<host>/Relativity.Rest/API/relativity-data-visualization/{versionNumber}/workspaces/{workspaceID}/views/{viewID}/eligible-owners

The request body is empty.

The response is an array of UserRef objects containing the following fields:

  • Name - the name of the user.
  • ArtifactID - the Artifact ID of a user. An ArtifactID set to 0 indicates that the view is public.
  • Guids - an array of GUIDs for the user.
[
    {
        "Name": "Public",
        "ArtifactID": 0,
        "Guids": []
    },
    {
        "Name": "Admin, Relativity",
        "ArtifactID": 9,
        "Guids": []
    },
    {
        "Name": "Service Account, Relativity",
        "ArtifactID": 777,
        "Guids": []
    }
]

Retrieve a list of object types in a workspace

You can retrieve a list of object types in a specific workspace. You can select an object type from this list that is used for populating the ObjectType field for the View object.

Send a GET request to a URL with the following format:

<host>/Relativity.Rest/API/relativity-data-visualization/{versionNumber}/workspaces/{workspaceID}/views/{viewID}/eligible-object-types 

The request body is empty.

The response is an array of ObjectTypeRef objects containing the following fields:

  • ArtifactTypeID - the ID for the artifact type of the object.
  • Name - the name of the object type.
  • ArtifactID - the Artifact ID of the object type.
  • Guids - an array of GUIDs for the object type.
[
 {
 "ArtifactTypeID": 0,
 "Name": "Analytics Categorization Result",
 "ArtifactID": 0,
 "Guids": []
 },
 {
 "ArtifactTypeID": 0,
 "Name": "Analytics Categorization Set",
 "ArtifactID": 0,
 "Guids": []
 },
 ....
]

Additional Resources

DevHelp Community GitHub Release Notes NuGet

Share knowledge with the Relativity developer community.

Access tools and resources to build an application.

Review the most recent product release notes.

Create .NET Apps faster with NuGet.