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:

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

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.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:

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:

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.

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:

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:

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-extensibility/{{version}}/workspace/{{WorkspaceArtifactID}}/objectTypes/{{ObjectTypeArtifactID}}/eventhandlers/{{EventHandlerID}}

Set the variables in the URL as follows:

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-extensibility/{{version}}/workspace/{{WorkspaceArtifactID}}/objectTypes/{{ObjectTypeArtifactID}}/eventhandlers/{{EventHandlerID}}

Set the variables in the URL as follows:

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-extensibility/{{version}}/workspace/{{WorkspaceArtifactID}}/objectTypes/{{ObjectTypeArtifactID}}/eventhandlers

Set the variables in the URL as follows:

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-extensibility/{{version}}/workspace/{{WorkspaceArtifactID}}/objectTypes/{{ObjectTypeArtifactID}}/availableeventhandlers

Set the variables in the URL as follows:

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:

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.

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:

{
   "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:

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:

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.

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.

Community Updates

Aero Developer FAQ Evolving the Platform Most recent release notes
Learn more Learn more Learn more

Additional Resources

   
Access Third-Party Tools with GitHub     Create .NET Apps Faster with NuGet
Visit github     visit nuget