View Manager service

In the REST API, the View Manager service provides endpoints for creating, reading, and updating views. It also provides endpoints for retrieving the following information:

  • The status of a user's permissions on a view and on fields used in the search conditions on a 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.
  • A list of each view in a workspace for a specific Artifact ID.
  • A list of each view that is associated with a saved search in a workspace.

You can use the View Manager service 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.

The Relativity Services API also provides functionality for managing views. For more information, see View Manager API.

This page contains the following information:

Client code sample

You can use the View Manager service by sending an HTTP request that makes a POST method call. See the following base URL for this service:

  <host>/Relativity.Rest/API/Relativity.Services.View.IViewModule/View%20Manager/

You can use the following .NET code as a REST client for making calls with the View Manager service. This code illustrates how to perform the following tasks:

  • Use helper classes to create the proxy and select an appropriate authentication type. See Relativity API Helpers.
  • Use the logging framework for troubleshooting and debugging purposes. See Log from a Relativity application .
  • 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 url variable to the URL for the operation that you want to perform.
  • Set the string represented by payload variable to the JSON input required for your operation.
  • Use the PostAsJsonAsync() method to send a post request.
  • Return the results of the request.

For information about running this code sample, see Relativity SDK samples.

Create a view in a workspace

Use the CreateSingleAsync endpoint to add a new view to a workspace. Send a request to this URL for the View Manager service:

  <host>/Relativity.Rest/API/Relativity.Services.View.IViewModule/View%20Manager/CreateSingleAsync

The JSON request includes fields for a user-friendly name, fields to be included in the view, sorting information, and other properties required to create a view.

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

Retrieve information about a view

Use the ReadSingleAsync endpoint to retrieve information about a view. Send a request to this URL for the View Manager service:

  <host>/Relativity.Rest/API/Relativity.Services.View.IViewModule/View%20Manager/ReadSingleAsync

The request must include the following fields:

  • workspaceArtifactID - the Artifact ID of the workspace that contains the view.
  • viewArtifactID - the Artifact ID of the view with the information that you want to retrieve.
1
2
3
4
{
   "workspaceArtifactID":1021106,
   "viewArtifactID":1042993
}

The JSON response for the ReadSingleAsync endpoint includes information about the object type assigned to the view, the owner, search criteria associated with it, sorting, and other data.

Retrieve each view in a workspace

You can retrieve each view in a workspace for a specific Artifact ID by making a call with the RetrieveViewsByContextArtifactIDAsync endpoint. To learn more, visit Views. Send a request to this URL for the View Manager service:

  <host>/Relativity.Rest/API/Relativity.Services.View.IViewModule/View%20Manager/RetrieveViewsByContextArtifactIDAsync

The JSON request includes the Artifact ID of the workspace which contains the view and the Artifact ID of the view.

Retrieve the views in a saved search

You can retrieve each view that is associated with a saved search in a workspace by making a call with the RetrieveViewsByContextArtifactIDForSearchAsync endpoint. To learn more, visit Saved Search. Send a request to this URL for the View Manager service:

  <host>/Relativity.Rest/API/Relativity.Services.View.IViewModule/View%20Manager/RetrieveViewsByContextArtifactIDForSearchAsync

The JSON request includes the Artifact ID of the workspace which contains the saved search(es).

JSON response contains an array of SearchViewResponse objects. Each of them represents properties of a single View for Search in a specified Workspace.

There is a number of fields that do not show up in JSON response if their value is null. These fields are: "Order", "SearchProviderID", "ThreadMethod", "PayloadFieldArtifactID", "GroupDefinitionArtifactID" and "DashboardArtifactID"

Update the properties of a view

You can update the properties of a view by making a call with the UpdateSingleAsync endpoint. Send a request to this URL for the View Manager service:

  <host>/Relativity.Rest/API/Relativity.Services.View.IViewModule/View%20Manager/UpdateSingleAsync

The JSON request includes fields for the workspace Artifact ID, the Artifact ID of the view, and other properties that you can update on the view.

The response returns a status code of 200 when the service successfully updates a view.

Retrieve the access status of a user

You can use the GetAccessStatusAsync endpoint to determine whether a user has View permissions to a view, and to the fields used in the criteria for search conditions on the view. Send a request to this URL for the View Manager service:

  <host>/Relativity.Rest/API/Relativity.Services.View.IViewModule/View%20Manager/GetAccessStatusAsync

The request must include the following fields:

  • workspaceArtifactID - the Artifact ID of the workspace that contains the view.
  • artifactID - the Artifact ID of the view that you want to check for user access status.
1
2
3
4
{
   "workspaceArtifactID":1021106,
   "artifactID":1041929
}

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 Server2021 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.
1
2
3
4
5
{
   "Exists":true,
   "CanView":true,
   "CanViewCriteriaFields":true
}

Retrieve users for assigning view ownership

Use the GetViewOwnersAsync endpoint to retrieve a list of users in a 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 Relativity Server2021 Documentation site.

To retrieve a list of users, send a request to this URL for the View Manager service:

  <host>/Relativity.Rest/API/Relativity.Services.View.IViewModule/View%20Manager/GetViewOwnersAsync

The request must contain the Artifact ID of the workspace that contains the view. When the owner is set to Public, all users with View permissions can see the view.

1
2
3
{
   "workspaceArtifactID":1028991
}

The response is an array of UserRef objects. Each object contains the ArtifactID and the name of a user.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[
   {
      "ArtifactID":0,
      "Name":"Public"
   },
   {
      "ArtifactID":9,
      "Name":"Admin, Relativity"
   },
   {
      "ArtifactID":777,
      "Name":"Service Account, Relativity"
   }
]

Retrieve a list of object types in a workspace

Use the GetObjectTypesAsync endpoint to retrieve a list of object types in a workspace. You can select an object type from this list that is used for populating the ObjectType field for the View object. Send a request to this URL for the View Manager service:

  <host>/Relativity.Rest/API/Relativity.Services.View.IViewModule/View%20Manager/GetObjectTypesAsync

The request must contain the Artifact ID of the workspace that contains the view.

1
2
3
{
   "workspaceArtifactID":1028991
}

The response is an array of ObjectTypeRef objects that contain the DescriptorArtifactTypeID, Guids, Name, and ArtifactID for the object type.