Object Type Manager service

Through the REST API, you can use the Object Type Manager service to programmatically create custom object types for use in your applications. This service includes the following features:

  • Support for create, read, update, and delete operations on object types.
  • Helper endpoints for retrieving parent object types and dependent objects.

Additionally, the following services provide functionality for working with event handlers, object rules, and mass operations for object types:

  • Event Handler Manager service - includes endpoints for attaching event handlers to and removing them from object types. It contains helper endpoints used for retrieving event handlers available in a workspace, and for retrieving event handlers currently attached to an object type.
  • Object Rule Manager service - includes endpoints for creating, updating, reading, or deleting object rules on an object type. It also provides helper endpoints for retrieving associative objects, layouts, choices, and choice fields used when creating an object rule.
  • Mass Operation Manager service - includes endpoints for creating, updating, reading, or deleting mass operations on an object type. It also provides helper endpoints for retrieving available object types, event handlers, and layouts for use with mass operations.

As a sample use case, you could use the Object Type Manager service to add new object types to support a custom application that you developed. You might want to implement an application that tracks vendor or customer information and decide to add different object types for each of these items. These object types could be further customized with object rules, event handlers, and mass operations.

The Relativity Services API supports the same functionality for this service as available through the REST API. For more information, see Object Type Manager API.

This page contains the following information:

Postman sample files

You can use the Postman sample files to become familiar with making calls to endpoints on the services for object types, including the Object Type Manager, Event Handler Manager, Object Rule Manager, and Mass Operation Manager services. To download the sample files, click ObjectTypePostmanFiles.zipObjectTypePostmanFiles.zip.

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 Object Type Manager service, send requests by making calls with the required HTTP methods. See the following base URL for this service:

<host>/relativity.rest/api/Relativity.objectTypes/workspace/{{WorkspaceID}}/objectTypes/

You can use the following .NET code as a sample client for creating an object type. This code illustrates how to perform the following tasks:

  • Instantiate an HttpClient object for sending requests to the Object Type Manager service.
  • Set the required headers for the request. For information on setting headers, see HTTP headers.
  • Initialize variables with the values for the object type to create, and the server where it should be added.
  • Set the url variable to the URL for the workspace where the object type is to be added. For more information, see Create an object type.
  • Set the JSON input required for the operation.
  • Use the PostAsync() method to send a POST request.
  • Return the results of the request and deserialize it.

Note: Follow a similar process when making calls to the Event Handler Manager, Object Rule Manager, and Mass Operation Manager services.

public async Task<int?> Create()
{
    int? result = null;    
    using (HttpClient client = new HttpClient())
    {
        client.DefaultRequestHeaders.Add("X-CSRF-Header", "-");
        client.DefaultRequestHeaders.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1").GetBytes("test@test.com:SomePassword")));
        client.DefaultRequestHeaders.Add("X-Kepler-Version", "2.0");
        client.BaseAddress = new Uri("https://localhost/");

        int workspaceId = 1018486;
        int parentArtifactTypeId= 10;
        int parentArtifactId = 1035231;
        int applicationId = 1035699; 

        string inputJSON = $"{{ \"ObjectTypeRequest\" : {{ \"ParentObjectType\": {{ \"Secured\": false, \"Value\": {{ \"ArtifactTypeID\": \"{parentArtifactTypeId}\", \"ArtifactID\": \"{parentArtifactId}\" }} }}, \"RelativityApplications\":[ {{ \"Secured\": false, \"Value\":{{ \"ArtifactID\": \"{applicationId}\" }} }} ], \"Name\": \"Object Test 1\", \"CopyInstancesOnCaseCreation\": false, \"CopyInstancesOnParentCopy\": false, \"EnableSnapshotAuditingOnDelete\": true, \"PersistentListsEnabled\": false, \"PivotEnabled\": true, \"SamplingEnabled\": false, \"Keywords\": \"\", \"Notes\": \"\" }} }}";
        var url = $@"/Relativity.rest/api/relativity.objectTypes/workspace/{workspaceId}/objectTypes/";
        var response = await client.PostAsync(url, new StringContent(inputJSON, Encoding.UTF8, "application/json"));
        response.EnsureSuccessStatusCode();
        var content = await response.Content.ReadAsStringAsync();
        result = JsonConvert.DeserializeObject<int>(content);
    }
    
    return result;
}

CRUD operations for object types

The Object Type Manager service supports create, read, update, and delete operations on object types. It also includes helper endpoints used to retrieve information about parent object types, and dependent objects.

Review the following guidelines for working with this service:

  • Verify that you have the appropriate permissions to access an object type before attempting to modify or delete it.
  • Verify that the Relativity application is unlocked before attempting to add an object type to it, or to modify or delete an existing object type. You also need permissions to the application and the object type to perform these tasks.

See the following subsections for more information:

Create an object type

When creating a new object type, you need to identify its parent object type. For more information, see Retrieve a parent object types.

To create an object type, send a POST request to a URL with the following format:

<host>/Relativity.rest/api/relativity.objectTypes/workspace/{{WorkspaceID}}/objectTypes/

Set the {{WorkspaceID}} variable to the Artifact ID of the workspace where you want to add the new object type, or use -1 to indicate the admin-level context.

When the request is successful, the response contains the Artifact ID of the new object type, such as 1042152. It also returns the status code of 200.

Read an object type

You can retrieve basic information about an object type or extended information, which also includes operations that you have permissions to perform on the object type.

  • Retrieve basic metadata for an object type - send a GET request to a URL with the following general format:
    <host>/Relativity.rest/api/relativity.objectTypes/workspace/{{WorkspaceID}}/objectTypes/{{ArtifactID}}
  • Retrieve extended metadata for an object type - send a GET request to a URL with the following general format:
    <host>/Relativity.rest/api/relativity.objectTypes/workspace/{{WorkspaceID}}/objectTypes/{{ArtifactID}}/true/true

For both requests, set the {{WorkspaceID}} variable to the Artifact ID of a workspace or use -1 to indicate the admin-level context. Set the {{ArtifactID}} variable to the Artifact ID of the object type that you want to read, and leave the body of the request empty.

Update an object type

To modify an object type, send a PUT request to a URL with the following general format:

<host>/Relativity.rest/api/relativity.objectTypes/workspace/{{WorkspaceID}}/objectTypes/{{ArtifactID}}

Set the {{WorkspaceID}} variable to the Artifact ID of the workspace containing the object type, or use -1 to indicate the admin-level context. Set the {{{ArtifactID}} variable to the Artifact ID of the object type that you want to update.

When the object type is successfully updated, the response returns the status code of 200.

Delete an object type

Before you delete an object type, you may want to call the dependencylist endpoint to retrieve a list of dependent objects. For more information, see Retrieve a list of dependent objects.

To remove an object type from Relativity, send a DELETE request to a URL with the following general format:

<host>/Relativity.rest/api/relativity.objectTypes/workspace/{{WorkspaceID}}/objectTypes/{{ToDelete}}

Set the {{WorkspaceID}} variable to the Artifact ID of the workspace containing the object type, or use -1 to indicate the admin-level context. Set the {{ToDelete}} variable to the Artifact ID of the object type that you want to delete.

The body of the request is empty. When the object type is successfully deleted, the response returns the status code of 200.

Retrieve a parent object types

Use the availableparentobjecttypes endpoint to retrieve a list of parent object types. You may want to call this endpoint before creating a new object type, because you must specify its parent object type. Fore more information, see Create an object type.

To call this endpoint, send a GET request to the URL with the following format:

<host>/relativity.rest/api/Relativity.objectTypes/workspace/{{WorkspaceID}}/objectTypes/availableparentobjecttypes

Set the {{WorkspaceID}} variable to the Artifact ID of the workspace containing the object type, or use -1 to indicate the admin-level context.

The response contains the following fields for each parent object type:

  • Name - the user-friendly name of the object type.
  • ArtifactTypeID - an integer value used as an identifier for an object type supported by Relativity. For example, the Artifact Type ID for a Document object is 10. See the ArtifactType enumeration in the Services API.
  • ArtifactID - the Artifact ID of the object type.
  • Guids - an array of GUIDs used to identify the object type.

Retrieve a list of dependent objects

You can use the dependencylist endpoint to retrieve information about objects dependent on the object type that you want to delete. This information includes the relationship between object type that you specified, and the dependent one.

To call the dependencylist endpoint, send a GET request to the URL with the following format:

<host>/relativity.rest/api/Relativity.objectTypes/workspace/{{WorkspaceID}}/objectTypes/{{ObjectTypeID}}/dependencylist

Set the {{WorkspaceID}} variable to the Artifact ID of the workspace containing the object type, or use -1 to indicate the admin-level context. Set the {{ObjectTypeID}} variable to the Artifact ID of object type.

Event Handler service for object types

You can add custom behavior to an object type by attaching event handlers to it. For example, you might attach an event handler that performs a specific action when a user makes an update to an object and then attempts to save it. For more information, see Develop object type event handlers.

The Event Handler Manager service contains an endpoints for programmatically attaching event handlers to an object type, and for detaching them. It also provides helper endpoints that you can use for the following purposes:

  • To retrieve a list of event handlers in a workspace, which could be attached to a specific object type.
  • To retrieve a list of event handlers currently attached to an object type.

See the following subsections for more information:

Attach an event handler to an object type

To attach an event handler to an object type, send a POST request to a URL with the following format:

<host>/relativity.rest/api/relativity.objectTypes/workspace/{{WorkspaceArtifactID}}/objectTypes/{{ObjectTypeArtifactID}}/eventhandlers/{{EventHandlerID}}

Set the variables in the URL as follows:

  • {{WorkspaceArtifactID}} - the Artifact ID of the workspace that contains the object type.
  • {{ObjectTypeArtifactID}} - the Artifact ID of the object type that you want to attach the event handler to.
  • {{EventHandlerID}} - the ID of the event handler.

    Note: The {{EventHandlerID}} is an identifier assigned by Relativity to the event handler. This identifier isn't the Artifact ID for the event handler. The endpoints for retrieving attached or available event handlers return a field that contains this ID. See Retrieve event handlers attached to an object type or Retrieve available event handlers for an object type.

The body of the request is empty. When the request is successful, the response returns the status code of 200.

Detach an event handler from an object type

To detach an event handler from an object type, send a DELETE request to a URL with the following format:

<host>/relativity.rest/api/relativity.objectTypes/workspace/{{WorkspaceArtifactID}}/objectTypes/{{ObjectTypeArtifactID}}/eventhandlers/{{EventHandlerID}}

Set the variables in the URL as follows:

  • {{WorkspaceArtifactID}} - the Artifact ID of the workspace that contains the object type.
  • {{ObjectTypeArtifactID}} - the Artifact ID of the object type that you want to detach the event handler from.
  • {{EventHandlerID}} - the ID of the event handler.

    Note: The {{EventHandlerID}} is an identifier assigned by Relativity to the event handler. This identifier isn't the Artifact ID for the event handler. The endpoints for retrieving attached or available event handlers return a field that contains this ID. See Retrieve event handlers attached to an object type or Retrieve available event handlers for an object type.

The body of the request is empty. When the request is successful, the response returns the status code of 200.

Retrieve event handlers attached to an object type

To retrieve a list of event handlers attached to an object type, send a GET request to a URL with the following format:

<host>/relativity.rest/api/relativity.objectTypes/workspace/{{WorkspaceArtifactID}}/objectTypes/{{ObjectTypeArtifactID}}/eventhandlers

Set the variables in the URL as follows:

  • {{WorkspaceArtifactID}} - the Artifact ID of the workspace that contains the object type.
  • {{ObjectTypeArtifactID}} - the Artifact ID of the object type that has attached event handlers to retrieve.

The body of the request is empty.

The response contains multiple fields, such as the Artifact ID of the event handler, name, and others. If no event handlers are available for the object type, this endpoint returns an empty array.

Retrieve available event handlers for an object type

To retrieve a list of event handlers available in a workspace to attach to a specific object type, send a GET request to a URL with the following format:

<host>/relativity.rest/api/relativity.objectTypes/workspace/{{WorkspaceArtifactID}}/objectTypes/{{ObjectTypeArtifactID}}/availableeventhandlers

Set the variables in the URL as follows:

  • {{WorkspaceArtifactID}} - the Artifact ID of the workspace that contains the object type.
  • {{ObjectTypeArtifactID}} - the Artifact ID of the object type that you want to retrieve a list of available event handlers for.

The body of the request is empty.

The response contains multiple fields, such as the Artifact ID of the event handler, name, and others. If no event handlers are available for the object type, this endpoint returns an empty array.

Object Rule Manager service

You can use object rules to further customize the behavior of the object types that you create. The Object Rule Manager service simplifies this process by supporting CRUD operations on object rules. It also provides helper endpoints for retrieving information about associative objects, layouts, choices and choice fields used when creating or updating an object rule. For a complete list of object rules, see Guidelines for the Object Rule Manager service.

See the following subsections for more information:

Guidelines for the Object Rule Manager service

Review the following guidelines for the Object Rule Manager service:

  • Use the Object Rule Manager service to work with the same object rule types available through the Relativity UI. For general information about object rules, see Adding an object rule
  • Use helper endpoints to retrieve information that you need when creating or updating an object rule. See the following table for suggested uses.
    Create or update this object rule Use these helper endpointsCompares to this UI field

    Choice Behavior

    availablechoicefieldsField

    Default Layout

    availablelayoutsAction
    availablechoicefieldsField
    availablechoicesValue

    Default Layout on New

    availablelayoutsAction

    Sub-List Button Visibility

    availablechoicefieldsField
    availablechoicesValue
    availableassociatedobjectsAssociative/Child Object
  • If a call to a helper endpoint returns an empty array, you can't create that object rule on the object type.
  • To attach an object rule, the object type must be an RDO and non-system object, or a document object type.
  • Use -1 for the workspace ID when you want to indicate the admin-level context.
  • To retrieve the Artifact ID of an object rule, use the Object Manager Service. For more information, see Object Manager service.

Create an object rule

You can create object rules by sending a POST request to the appropriate URL for the rule type. For general information about these object rules, see Adding an object rule.

Click the following drop-down links to view URLs and sample requests for sub-list visibility, choices, and layouts rules. You can find the URLs and JSON request formats for other object type rules in the Postman file provided for this service. For more information, see Postman sample files.

For the URLs in these examples, set the {{WorkspaceID}} variable to the Artifact ID of the workspace containing the object type, or use -1 to indicate the admin-level context.

When the request is successful, the response contains the Artifact ID of the new object rule. It also returns the status code of 200.

Read an object rule

You can retrieve basic information about an object rule or extended information, which also includes operations that you have permissions to perform on the object rule.

  • Retrieve basic metadata for an object rule - send a GET request to a URL with the following general format:
    <host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/{{ObjectRuleId}}
  • Retrieve extended metadata for an object rule - send a GET request to a URL with the following general format:
    <host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/{{ObjectRuleId}}/true/true

For both requests, set the {{WorkspaceID}} variable to the Artifact ID of a workspace or use -1 to indicate the admin-level context. Set the {{ObjectRuleId}} variable to the Artifact ID of the object rule that you want to read, and leave the body of the request empty.

Update an object rule

You can update object rules by sending a PUT request to the appropriate URL for the rule type. For general information about object rules, see Adding an object rule.

Click the following drop-down links to view URLs and sample requests for sub-list visibility, choices, and layouts rules. You can find the URLs and JSON request formats for other object type rules in the Postman file provided for this service. For more information, see Postman sample files.

For the URLs in these examples, set the {{WorkspaceID}} variable to the Artifact ID of the workspace containing the object type, or use -1 to indicate the admin-level context. Set the {{ObjectRuleId}} variable to the Artifact ID of the object type.

When an update request is successful, the response returns the status code of 200.

Delete an object rule

To remove an object rule, send a DELETE request to a URL with the following general format:

<host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/{{ObjectRuleId}}

The body of the request is empty. When the object rule is successfully deleted, the response returns the status code of 200.

Delete multiple object rules

You can remove multiple object rules on the same object type and across different object types by making a single call to the mass-delete endpoint. Send a POST request to a URL with the following general format:

<host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/mass-delete

The body of the request must contains an array of object rules with the following fields:

  • ArtifactID - the Artifact ID of the object rule.
  • GUID - an array of GUIDs used to identify the object rule. This array can be empty.
{
   "ObjectRules":[
      {
         "ArtifactID":1039509,
         "GUID":[

         ]
      },
      {
         "ArtifactID":1039525,
         "GUID":[

         ]
      },
      {
         "ArtifactID":1039630,
         "GUID":[

         ]
      }
   ]
}

When the object rules are successfully deleted, the response returns the status code of 200.

Retrieve choices, choice fields, layouts, or associated objects

When you create or update an object rule, you must provide the Artifact ID of any associative objects, layouts, choices and choice fields that it references. The Object Rule Manager service provides several helper endpoints that you can use to retrieve the Artifact ID, name, and other information about these objects. For most objects, it includes endpoints for the following types of requests:

  • GET request - use the endpoint for this request if you have the Artifact ID for an object type.
  • POST request - use the endpoint for this request if you have the user-friendly name of the object type, but not its Artifact ID.

For more information, see Guidelines for the Object Rule Manager service.

Mass Operation Manager service

You can add mass operations to object types to further customize their behavior. When a user interacts with a mass operation, you can display a custom page or execute an event handler with specialized functionality. For general information about mass operations, see Adding a custom mass operation.

The Mass Operation Manager service includes endpoints for creating, reading, updating, and deleting mass operations. It also includes helper endpoints for retrieving information about object types that be associated with a mass operation, and available event handlers and layouts for use with mass operations.

Review the following guidelines for working with this service:

  • Make sure that you set the appropriate field values for the type of mass operation that you want to create. See Create an object type and Update an object type.
  • Use the helper endpoints to retrieve object types, event handlers, and layouts available for associating with mass operation.
  • Mass operations aren't available in the admin-level context, so you must specify a workspace ID.

See the following subsections for more information:

Create a mass operation

You can a create a mass operation that displays a custom page or that executes a custom event handler when a user interacts with it. For general information about mass operations, see Adding a custom mass operation.

Click the following drop-down links to view URLs and sample requests for mass operations that use a custom page or an event handler. For the URLs in these examples, set the {{WorkspaceID}} variable to the Artifact ID of a workspace.

When a custom page or event handler mass operation is successfully created, the response contains the Artifact ID of the mass operation, such as 1042616. It also returns a status code of 200.

Read a mass operation

You can retrieve basic information about a mass operation or extended information, which also includes operations that you have permissions to perform on the mass operation.

  • Retrieve basic metadata for a mass operation - send a GET request to a URL with the following general format:
    <host>/Relativity.REST/api/Relativity.MassOperations/workspace/{{workspaceId}}/massoperations/{{massOperationId}}
  • Retrieve extended metadata for a mass operation - send a GET request to a URL with the following general format:
    <host>/Relativity.REST/api/Relativity.MassOperations/workspace/{{workspaceId}}/massoperations/{{massOperationId}}/true/true

For both requests, set the {{WorkspaceID}} variable to the Artifact ID of a workspace. Set the {{massOperationId}} variable to the Artifact ID of the mass operation that you want to read, and leave the body of the request empty.

Update a mass operation

You can update a mass operation by sending a PUT request to the endpoint for a custom page or event handler mass operation.

Click the following drop-down links to view URLs and sample requests for custom page and event handler mass operations.

For the URLs in these examples, set the {{WorkspaceID}} variable to the Artifact ID of a workspace. Set the {{massOperationId}} variable to the Artifact ID of the mass operation.

When a mass operation is successfully updated, the response returns a status code of 200.

Delete a mass operation

To remove a mass operation, send a DELETE request to the following URL:

<host>/Relativity.REST/api/Relativity.MassOperations/workspace/{{workspaceId}}/massoperations/{{massOperationId}}

Set the {{WorkspaceID}} variable to the Artifact ID of a workspace. Set the {{massOperationId}} variable to the Artifact ID of the mass operation.

The body of the request is empty. When the mass operation is successfully deleted, the response is a status code of 200.

Retrieve available object types for a mass operation

You can customize your object types with additional functionality by creating mass operations for them.

To retrieve a list of object types available in a workspace, send a POST request to the following URL:

<host>/Relativity.REST/api/Relativity.MassOperations/workspace/{{workspaceId}}/massoperations/availableobjecttypes

Set the {{WorkspaceID}} variable to the Artifact ID of a workspace.

The body of the request is empty.

Retrieve available event handlers for a mass operation

You can add an event handler for a mass operation to an object type. This event handler executes when the user executes the mass operation through the Relativity UI. You can retrieve a list of event handlers available for the object type by calling the availableeventhandlers endpoint. For general information about event handlers, see Create an object type.

To retrieve a list of available event handlers, send a POST request to the following URL:

<host>/Relativity.REST/api/Relativity.MassOperations/workspace/{{workspaceId}}/eventhandlermassoperations/availableeventhandlers

Set the {{WorkspaceID}} variable to the Artifact ID of a workspace.

The body of the request is empty.

Retrieve available layouts for a mass operation

When you add a mass operation that uses an event handler to an object type, you must select a layout that displays after the user initiates the operation in the Relativity UI. You can retrieve a list of layouts available for the object type by calling the availablelayouts endpoint. For general information about layouts, see Create an object type.

To retrieve a list of available layouts, send a POST request to the following URL:

<host>/Relativity.REST/api/Relativity.MassOperations/workspace/{{workspaceId}}/eventhandlermassoperations/availablelayouts

Set the {{WorkspaceID}} variable to the Artifact ID of a workspace.