Object Rule Manager (REST)

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 methods for retrieving information about associative objects, layouts, choices and choice fields used when creating or updating an object rule.

You can also work with this service through .NET. For more information, see Object Rule Manager (.NET).

Postman sample files

You can use the Postman sample files to become familiar with making calls to endpoints on the services. To download the sample files, click V1 Object Rule postman_collection.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.

Guidelines for the Object Rule Manager service

Review the following guidelines for the Object Rule Manager service:

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.
  • Note: To indicate the admin-level context, set the {workspaceID} path parameter to -1.

Fundamentals for 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 (REST).

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 with a URL in the following general format:
    Copy
    <host>/Relativity.rest/api/relativity-data-visualization/{versionNumber}/workspaces/{WorkspaceID}/object-rules/{ObjectRuleId}
  • Retrieve extended metadata for an object rule - send a GET request with a URL in the following general format:
    Copy
    <host>/Relativity.rest/api/relativity-data-visualization/{versionNumber}/workspaces/{WorkspaceID}/object-rules/{ObjectRuleId}?includeMetadata=true&includeActions=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 with a URL in the following general format:

Copy
<host>/Relativity.rest/api/relativity-data-visualization/{versionNumber}/workspaces/{WorkspaceID}/object-rules/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 with a URL in the following general format:

Copy
<host>/Relativity.rest/api/relativity-data-visualization/{versionNumber}/workspaces/{WorkspaceID}/object-rules/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.
Copy
{
   "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.