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 (.NET).
This page contains the following information:
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:
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; }
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:
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.
The body of the request must contain the following fields unless specifically identified as optional:
{ "ObjectTypeRequest" : { "ParentObjectType": { "Secured": false, "Value": { "ArtifactTypeID": 10, "ArtifactID": 1035231 } }, "RelativityApplications":[ { "ArtifactID": 1045231 } ], "Name": "My Custom Object Type", "CopyInstancesOnCaseCreation": false, "CopyInstancesOnParentCopy": false, "EnableSnapshotAuditingOnDelete": true, "PersistentListsEnabled": false, "PivotEnabled": true, "SamplingEnabled": false, "Keywords": "", "Notes": "" } }
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.
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.
<host>/Relativity.rest/api/relativity.objectTypes/workspace/{{WorkspaceID}}/objectTypes/{{ArtifactID}}
<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.
{ "ArtifactTypeID": 5, "ParentObjectType": { "Secured": false, "Value": { "Name": "System", "ArtifactTypeID": 1, "ArtifactID": 1016168, "Guids": [] } }, "CopyInstancesOnCaseCreation": false, "CopyInstancesOnParentCopy": false, "EnableSnapshotAuditingOnDelete": true, "IsDynamic": false, "IsSystem": true, "IsViewEnabled": true, "PersistentListsEnabled": false, "PivotEnabled": false, "SamplingEnabled": false, "FieldByteUsage": 0, "RelativityApplications": { "HasSecuredItems": false, "ViewableItems": [] }, "CreatedOn": "2018-05-14T18:31:49.787", "CreatedBy": { "Name": "Doe, Jane", "ArtifactID": 9, "Guids": [] }, "LastModifiedBy": { "Name": "Doe, Jane", "ArtifactID": 9, "Guids": [] }, "LastModifiedOn": "2018-05-14T18:31:49.787", "Keywords": "", "Notes": "RDO in Admin", "Name": "Client", "ArtifactID": 1016170, "Guids": [] }
{ "ArtifactTypeID": 5, "ParentObjectType": { "Secured": false, "Value": { "Name": "System", "ArtifactTypeID": 1, "ArtifactID": 1016168, "Guids": [] } }, "CopyInstancesOnCaseCreation": false, "CopyInstancesOnParentCopy": false, "EnableSnapshotAuditingOnDelete": true, "IsDynamic": false, "IsSystem": true, "IsViewEnabled": true, "PersistentListsEnabled": false, "PivotEnabled": false, "SamplingEnabled": false, "FieldByteUsage": 0, "RelativityApplications": { "HasSecuredItems": false, "ViewableItems": [] }, "CreatedOn": "2018-05-14T18:31:49.787", "CreatedBy": { "Name": "Doe, Jane", "ArtifactID": 9, "Guids": [] }, "LastModifiedBy": { "Name": "Doe, Jane", "ArtifactID": 9, "Guids": [] }, "LastModifiedOn": "2018-05-14T18:31:49.787", "Keywords": "", "Notes": "RDO in Admin", "Meta": { "Unsupported": [ "SamplingEnabled", "PersistentListsEnabled", "CopyInstancesOnCaseCreation", "RelativityApplications", "CopyInstancesOnParentCopy", "UseRelativityForms" ], "ReadOnly": [ "ParentObjectType", "IsDynamic", "EnableSnapshotAuditingOnDelete", "PivotEnabled", "Name" ] }, "Actions": [ { "Name": "Delete", "Href": "Relativity.ObjectTypes/workspace/-1/objecttypes/1016170", "Verb": "DELETE", "IsAvailable": true, "Reason": [] }, { "Name": "Update", "Href": "Relativity.ObjectTypes/workspace/-1/objecttypes/1016170", "Verb": "PUT", "IsAvailable": true, "Reason": [] } ], "Name": "Client", "ArtifactID": 1016170, "Guids": [] }
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.
The body of the request must contain the following fields unless specifically identified as optional:
{ "ObjectTypeRequest":{ "ParentObjectType":{ "Secured":false, "Value": { "Name": "System", "ArtifactTypeID": 1, "ArtifactID": 1016168, "Guids": [] } }, "RelativityApplications":[ { "ArtifactID": 1045231 } ], "Name":"My Object Type", "CopyInstancesOnCaseCreation":false, "CopyInstancesOnParentCopy":false, "EnableSnapshotAuditingOnDelete":true, "PersistentListsEnabled":false, "PivotEnabled":false, "SamplingEnabled":false, "Keywords":"updated", "Notes":"Renamed object type" }, "LastModifiedOn":"2018-10-19T18:41:20.54" }
When the object type is successfully updated, the response returns the status code of 200.
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.
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": "Analytics Categorization Result", "ArtifactTypeID": 1000017, "ArtifactID": 1036390, "Guids": [] }, { "Name": "Analytics Categorization Set", "ArtifactTypeID": 1000018, "ArtifactID": 1036399, "Guids": [] }, { "Name": "Analytics Categorization Set Build History", "ArtifactTypeID": 1000045, "ArtifactID": 1039799, "Guids": [] }, { "Name": "Analytics Category", "ArtifactTypeID": 1000019, "ArtifactID": 1036408, "Guids": [] }, { "Name": "Workspace", "ArtifactTypeID": 8, "ArtifactID": 1035229, "Guids": [] } ]
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.
The response contains the following fields:
[ { "ObjectType": { "Secured": false, "Value": "Object Type (Level 1)" }, "Action": "Delete", "Count": { "Secured": false, "Value": 1 }, "Connection": { "Secured": false, "Value": "Parent" }, "HierarchicLevel": 0 }, { "ObjectType": { "Secured": false, "Value": "Layout" }, "Action": "Delete", "Count": { "Secured": false, "Value": 1 }, "Connection": { "Secured": false, "Value": "Child of: Object Type (Level 1)" }, "HierarchicLevel": 0 }, { "ObjectType": { "Secured": false, "Value": "View" }, "Action": "Delete", "Count": { "Secured": false, "Value": 1 }, "Connection": { "Secured": false, "Value": "Child of: Object Type (Level 1)" }, "HierarchicLevel": 0 } ]
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:
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:
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.
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:
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.
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:
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.
[ { "ID": 20565, "ArtifactID": 1042543, "Execution": "PreSave", "Application": { "Name": "Default", "ArtifactID": 0, "Guids": [ "3e86b18f-8b55-45c4-9a57-9e0cbd7baf46" ] }, "AssemblyName": "myassembly.dll", "ClassName": "myassembly.MyPreSave", "CompanyName": "", "Description": "" } ]
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:
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.
[ { "ID":20564, "ArtifactID":0, "Execution":"PreSave", "Application":{ "Name":"Default", "ArtifactID":0, "Guids":[ "3e86b18f-8b55-45c4-9a57-9e0cbd7baf46" ] }, "AssemblyName":"testEH.dll", "ClassName":"testEH.REHEPreSave", "CompanyName":"", "Description":"" }, { "ID":20566, "ArtifactID":0, "Execution":"PreSave", "Application":{ "Name":"Default", "ArtifactID":0, "Guids":[ "3e86b18f-8b55-45c4-9a57-9e0cbd7baf46" ] }, "AssemblyName":"testEHg.dll", "ClassName":"testEHg.REHEPreSave", "CompanyName":"", "Description":"" }, { "ID":20565, "ArtifactID":0, "Execution":"PreSave", "Application":{ "Name":"Default", "ArtifactID":0, "Guids":[ "3e86b18f-8b55-45c4-9a57-9e0cbd7baf46" ] }, "AssemblyName":"myassembly.dll", "ClassName":"myassembly.MyPreSave", "CompanyName":"", "Description":"" } ]
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:
Review the following guidelines for the Object Rule Manager service:
Create or update this object rule | Use these helper endpoints | Compares to this UI field |
---|---|---|
availablechoicefields | Field | |
availablelayouts | Action | |
availablechoicefields | Field | |
availablechoices | Value | |
availablelayouts | Action | |
availablechoicefields | Field | |
availablechoices | Value | |
availableassociatedobjects | Associative/Child Object |
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.
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/choicebehaviorobjectrules
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/customsingleobjectaddlinkvisibilityobjectrules
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/defaultlayoutobjectrules
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/defaultlayoutonnewobjectrules
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/globalbuttonvisibilityobjectrules
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/massactionvisibilityobjectrules
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/newbuttonoverrideobjectrules
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/sublistbuttonvisibilityobjectrules
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/overrideeditlinkobjectrules
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/overrideeditlinkobjectrules
To create a sub-list visibility rule, send a POST request to a URL with the following format:
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/sublistbuttonvisibilityobjectrules
The body of the request must contain the following fields unless specifically identified as optional:
{ "objectRuleRequest":{ "Name": "Sample rule for sublist button", "ObjectType": { "ArtifactID": 1042378 }, "Field": { "Value": { "ArtifactID": 1042566 } }, "Choice": { "Value": { "ArtifactID": 1042568 } }, "SubListObject": { "Value": { "ArtifactID": 1042586 } }, "ShowNew": true, "ShowLink": false, "ShowUnlink": false, "RelativityApplications": [] } }
To create a choice rule, send a POST request to a URL with the following format:
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/choicebehaviorobjectrules
The body of the request must contain the following fields unless specifically identified as optional:
{ "objectRuleRequest":{ "Name": "Sample Rule One", "ObjectType": { "ArtifactID": 1042378 }, "AllowAdd": true, "AllowDelete": true, "AllowRename": true, "Field": { "Value": { "ArtifactID": 1042565 } }, "RelativityApplications": [] } }
To create a layout rule, send a POST request to a URL with the following format:
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/defaultlayoutobjectrules
The body of the request must contain the following fields unless specifically identified as optional:
{ "objectRuleRequest":{ "Name": "Sample rule for layout", "ObjectType": { "ArtifactID": 1042378 }, "Field": { "Value": { "ArtifactID": 1042566 } }, "Layout": { "Value": { "ArtifactID": 1042594 } }, "Choice": { "Value": { "ArtifactID": 1042569 } }, "AllowLayoutChange": false, "RelativityApplications": [] } }
When the request is successful, the response contains the Artifact ID of the new object rule. It also returns the status code of 200.
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.
<host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/{{ObjectRuleId}}
<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.
The ListType field contains one of the following values:
For more information, see the ListType Enumeration in the Relativity.Services.Interfaces.ObjectRules.Models namespace.
{ "Behavior": "SubListButtonVisibility", "Field": { "Secured": false, "Value": { "Name": "Custom Single Choice Field", "ArtifactID": 1042566, "Guids": [] } }, "Choice": { "Secured": false, "Value": { "Name": "Green", "ArtifactID": 1042568, "Guids": [] } }, "SubListObject": { "Secured": false, "Value": { "Name": "Associated object example", "ArtifactTypeID": 1000051, "ArtifactID": 1042586, "Guids": [], "ListType": "ChildObject" } }, "AllowAdd": false, "AllowDelete": false, "AllowRename": false, "ShowDelete": false, "ShowAddLink": false, "AllowLayoutChange": false, "ShowNew": true, "ShowLink": false, "ShowUnlink": false, "ShowMassCopy": false, "ShowMassEdit": false, "ShowMassReplace": false, "ShowMassTally": false, "RelativityApplications": { "HasSecuredItems": false, "ViewableItems": [] }, "ObjectType": { "Name": "Custom Object Type", "ArtifactTypeID": 1000048, "ArtifactID": 1042378, "Guids": [] }, "Actions": [], "LastModifiedOn": "2019-02-22T19:22:49.927", "LastModifiedBy": { "Name": "Doe, Jane", "ArtifactID": 1023652, "Guids": [] }, "CreatedOn": "2019-02-22T17:40:24.7", "CreatedBy": { "Name": "Doe, Jane", "ArtifactID": 1023652, "Guids": [] }, "Name": "Updated object rule", "ArtifactID": 1042590, "Guids": [] }
{ "Behavior": "SubListButtonVisibility", "Field": { "Secured": false, "Value": { "Name": "Custom Single Choice Field", "ArtifactID": 1042566, "Guids": [] } }, "Layout": { "Secured": false, "Value": { "Name": "Custom Layout", "ArtifactID": 1042594, "Guids": [] } }, "Choice": { "Secured": false, "Value": { "Name": "Custom Choice", "ArtifactID": 1042569, "Guids": [] } }, "SubListObject": { "Secured": false, "Value": { "Name": "Associated object example", "ArtifactTypeID": 1000051, "ArtifactID": 1042586, "Guids": [], "ListType": "ChildObject" } }, "AllowAdd": false, "AllowDelete": false, "AllowRename": false, "ShowDelete": false, "ShowAddLink": false, "AllowLayoutChange": false, "ShowNew": false, "ShowLink": false, "ShowUnlink": false, "ShowMassCopy": false, "ShowMassEdit": false, "ShowMassReplace": false, "ShowMassTally": false, "RelativityApplications": { "HasSecuredItems": false, "ViewableItems": [] }, "ObjectType": { "Name": "Custom Object Type", "ArtifactTypeID": 1000048, "ArtifactID": 1042378, "Guids": [] }, "Meta": { "Unsupported": [], "ReadOnly": [ "RuleType" ] }, "Actions": [ { "Name": "Delete", "Href": "Relativity.ObjectRules/workspace/2342954/objectrules/1042595", "Verb": "DELETE", "IsAvailable": true, "Reason": [] }, { "Name": "Update", "Href": "Relativity.ObjectRules/workspace/2342954/DefaultLayoutobjectrules/1042595", "Verb": "PUT", "IsAvailable": true, "Reason": [] } ], "LastModifiedOn": "2019-02-22T17:55:04.253", "LastModifiedBy": { "Name": "Doe, Jane", "ArtifactID": 1023652, "Guids": [] }, "CreatedOn": "2019-02-22T17:55:04.253", "CreatedBy": { "Name": "Doe, Jane", "ArtifactID": 1023652, "Guids": [] }, "Name": "Sample rule for layout", "ArtifactID": 1042595, "Guids": [] }
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.
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/choicebehaviorobjectrules/{{ObjectRuleId}}
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/customsingleobjectaddlinkvisibilityobjectrules/{{ObjectRuleId}}
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/defaultLayoutobjectrules/{{ObjectRuleId}}
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/defaultlayoutonnewobjectrules/{{ObjectRuleId}}
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/globalbuttonvisibilityobjectrules
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/massactionvisibilityobjectrules/{{ObjectRuleId}}
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/newbuttonoverrideobjectrules/{{ObjectRuleId}}
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/sublistbuttonvisibilityobjectrules/{{ObjectRuleId}}
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/overrideeditlinkobjectrules/{{ObjectRuleId}}
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/overrideviewlinkobjectrules/{{ObjectRuleId}}
To update a sub-list visibility rule, send a PUT request to a URL with the following format:
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/sublistbuttonvisibilityobjectrules/{{ObjectRuleId}}
The body of the request must contain the following fields unless specifically identified as optional:
{ "objectRuleRequest":{ "Name": "Updated object rule", "ObjectType": { "ArtifactID": 1042378 }, "Field": { "Value": { "ArtifactID": 1042566 } }, "Choice": { "Value": { "ArtifactID": 1042568 } }, "SubListObject": { "Value": { "ArtifactID": 1042586 } }, "ShowNew": true, "ShowLink": false, "ShowUnlink": false, "RelativityApplications": [] }, "LastModifiedOn": "2019-02-22T19:33:57.89" }
To update a choice rule, send a PUT request to a URL with the following format:
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/choicebehaviorobjectrules/{{ObjectRuleId}}
The body of the request must contain the following fields unless specifically identified as optional:
{ "objectRuleRequest":{ "Name": "Update choice behavior", "ObjectType": { "ArtifactID": 1042378 }, "AllowAdd": true, "AllowDelete": false, "AllowRename": true, "Field": { "Value": { "ArtifactID": 1042565 } }, "RelativityApplications": [] }, "LastModifiedOn": "2019-02-22T19:33:57.89" }
To update a layout rule, send a PUT request to a URL with the following format:
<host>/relativity.rest/api/relativity.objectrules/workspace/{{WorkspaceArtifactId}}/defaultLayoutobjectrules/{{ObjectRuleId}}
The body of the request must contain the following fields unless specifically identified as optional:
{ "objectRuleRequest":{ "Name": "Updated rule for default layout", "ObjectType": { "ArtifactID":1042378 }, "Field": { "Value": { "ArtifactID": 1042566 } }, "Layout": { "Value": { "ArtifactID": 1042594 } }, "Choice": { "Value": { "ArtifactID": 1042569 } }, "AllowLayoutChange": false, "RelativityApplications": [] }, "LastModifiedOn": "2019-02-22T19:33:57.89" }
When an update request is successful, the response returns the status code of 200.
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.
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.
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.
Use the following endpoints to retrieve associated objects for a specific object type:
<host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/availableassociatedobjects/{{ObjectTypeArtifactId}}
<host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/availableassociatedobjects
The body of the request contains the following fields:
{ "ObjectTypeID" : { "ArtifactID": 1036417, "Name": "Analytics Example" } }
The response for both the GET and POST request contains the following fields:
For more information, see the ListType Enumeration in the Relativity.Services.Interfaces.ObjectRules.Models namespace.
If no associated objects are available for the object type, this endpoint returns an empty array.
[ { "Name": "Category Example", "ArtifactTypeID": 1000017, "ArtifactID": 1036424, "Guids": [ "f611b0e4-6d92-4ff6-a247-46e87685bfc9" ], ListType: "ChildObject" } ]
Use the following endpoints to retrieve single choice fields for a specific object type:
<host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/availablesinglechoicefields/{{ObjectTypeArtifactId}}
Retrieve with Artifact ID or name - send a POST request to a URL with the following general format:
<host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/availablesinglechoicefields
The body of the request contains the following fields:
{ "ObjectTypeID" : { "ArtifactID": 1042378, "Name": "Custom Object Type" } }
The response for both the GET and POST request contains the following fields:
If no associated single choice fields are available for the object type, this endpoint returns an empty array.
[ { "Name": "Custom Single Choice Field", "ArtifactID": 1042566, "Guids": [] }, { "Name": "Single Choice Field", "ArtifactID": 1042564, "Guids": [] } ]
Use the following endpoints to retrieve single and multiple choice fields for a specific object type:
<host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/availablechoicefields/{{ObjectTypeArtifactId}}
Retrieve with Artifact ID or name - send a POST request to a URL with the following general format:
<host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/availablechoicefields/
The body of the request contains the following fields:
{ "ObjectTypeID" : { "ArtifactID": 1042378, "Name": "Custom Object Type" } }
The response for both the GET and POST request contains the following fields:
If no choice fields are available for the object type, this endpoint returns an empty array.
[ { "Name": "Custom Single Choice Field", "ArtifactID": 1042566, "Guids": [] }, { "Name": "Multiple Choice Field", "ArtifactID": 1042565, "Guids": [] }, { "Name": "Single Choice Field", "ArtifactID": 1042564, "Guids": [] } ]
To retrieve a list of choices for an object type, send a GET request to a URL with the following general format:
<host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/availablechoices/{{FieldId}}
The response contains the following fields:
If no choice are available for the object type, this endpoint returns an empty array.
[ { "Name": "Blue", "ArtifactID": 1042569, "Guids": [] }, { "Name": "Green", "ArtifactID": 1042568, "Guids": [] }, { "Name": "Orange", "ArtifactID": 1042570, "Guids": [] } ]
Use the following endpoints to retrieve layouts for a specific object type:
<host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/availablelayouts/{{ObjectTypeArtifactId}}
Retrieve with Artifact ID or name - send a POST request to a URL with the following general format:
<host>/Relativity.rest/api/relativity.objectRules/workspace/{{WorkspaceArtifactId}}/objectrules/availablelayouts
The body of the request contains the following fields:
{ "ObjectTypeID" : { "ArtifactID": 1042378, "Name" : "Custom Object Type" } }
The response for both the GET and POST request contains the following fields:
If no layouts are available for the object type, this endpoint returns an empty array.
[ { "Name": "Custom Object Type Layout", "ArtifactID": 1042377, "Guids": [] } ]
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:
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.
To create a mass operations that displays a custom page for a user, send a POST request to the following URL:
<host>/Relativity.REST/api/Relativity.MassOperations/workspace/{{workspaceId}}/custompagemassoperations
The body of the request must contain the following fields unless specifically identified as optional:
{ "MassOperationRequest":{ "Name":"Custom page mass operation", "ObjectType":{ "ArtifactID":1042378, "ArtifactTypeID":1000048, "Guids":[], "Name":"Custom Object Type" }, "RelativityApplications": [ { "ArtifactID":1042630, "Guids":[] } ], "Url":"https://www.mydomain.corp/MySite/Content/MyCustomPage.htm", "PopupHeight":500, "PopupWidth":500 } }
To create a mass operation that executes an event handler, send a POST request to the following URL:
<host>/Relativity.REST/api/Relativity.MassOperations/workspace/{{workspaceId}}/eventhandlermassoperations
The body of the request must contain the following fields unless specifically identified as optional:
{ "MassOperationRequest": { "Name": "Event handler mass operation", "ObjectType": { "ArtifactID": 1042378, "ArtifactTypeID" : 1000048, "Guids": [], "Name": "Custom Object Type" }, "RelativityApplications": [ { "ArtifactID":1042630, "Guids":[] } ], "EventHandlerID": "3717", "Layout": { "Value": { "ArtifactID": 1042377, "Guids": [] } } } }
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.
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.
<host>/Relativity.REST/api/Relativity.MassOperations/workspace/{{workspaceId}}/massoperations/{{massOperationId}}
<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.
The response contains the following fields:
Meta - provides additional information available as extended metadata. It includes the following fields:
{ "Type": "EventHandlerMassOperation", "Name": "Event handler mass operation", "ObjectType": { "ArtifactID": 1042378, "Guids": [] }, "RelativityApplications": { "HasSecuredItems": false, "ViewableItems": [ { "Name": "MySampleApplication", "ArtifactID": 1042630, "Guids": [ "555556e4-0f70-4b3a-85cc-bb8572b600f1" ] } ] }, "PopupHeight": 0, "PopupWidth": 0, "EventHandlerID": 3717, "ClassName": "Test.Relativity.EventHandlers.MassOperations.GenerateExcelTextHandler", "ApplicationName": "TEST", "Layout": { "Secured": false, "Value": { "Name": "Custom Object Type Layout", "ArtifactID": 1042377, "Guids": [] } }, "CreatedOn": "2019-03-06T19:53:06.413", "CreatedBy": { "Name": "Doe, Jane", "ArtifactID": 1023652, "Guids": [] }, "LastModifiedBy": { "Name": "Doe, Jane", "ArtifactID": 1023652, "Guids": [] }, "LastModifiedOn": "2019-03-06T19:53:06.413", "Actions": [], "ArtifactID": 1042616, "Guids": [] }
{ "Type": "CustomPageMassOperation", "Name": "Custom page mass operation", "ObjectType": { "ArtifactID": 1042378, "Guids": [] }, "RelativityApplications": { "HasSecuredItems": false, "ViewableItems": [ { "Name": "MySampleApplication", "ArtifactID": 1042630, "Guids": [ "555556e4-0f70-4b3a-85cc-bb8572b600f1" ] } ] }, "Url": "https://www.mydomain.corp/MySite/Content/MyCustomPage.htm", "PopupHeight": 500, "PopupWidth": 500, "EventHandlerID": 0, "CreatedOn": "2019-03-06T18:56:10.047", "CreatedBy": { "Name": "Doe, Jane", "ArtifactID": 1023652, "Guids": [] }, "LastModifiedBy": { "Name": "Doe, Jane", "ArtifactID": 1023652, "Guids": [] }, "LastModifiedOn": "2019-03-06T18:56:10.047", "Meta": { "Unsupported": [], "ReadOnly": [] }, "Actions": [ { "Name": "Delete", "Href": "Relativity.MassOperations/workspace/2342954/massoperations/1042615", "Verb": "DELETE", "IsAvailable": true, "Reason": [] }, { "Name": "Update", "Href": "Relativity.MassOperations/workspace/2342954/custompagemassoperations/1042615", "Verb": "PUT", "IsAvailable": true, "Reason": [] } ], "ArtifactID": 1042615, "Guids": [] }
{ "Type": "EventHandlerMassOperation", "Name": "Event handler mass operation", "ObjectType": { "ArtifactID": 1042378, "Guids": [] }, "RelativityApplications": { "HasSecuredItems": false, "ViewableItems": [ { "Name": "MySampleApplication", "ArtifactID": 1042630, "Guids": [ "555556e4-0f70-4b3a-85cc-bb8572b600f1" ] } ] }, "PopupHeight": 0, "PopupWidth": 0, "EventHandlerID": 3717, "ClassName": "Test.Relativity.EventHandlers.MassOperations.GenerateExcelTextHandler", "ApplicationName": "TEST", "Layout": { "Secured": false, "Value": { "Name": "Custom Object Type Layout", "ArtifactID": 1042377, "Guids": [] } }, "CreatedOn": "2019-03-06T19:53:06.413", "CreatedBy": { "Name": "Doe, Jane", "ArtifactID": 1023652, "Guids": [] }, "LastModifiedBy": { "Name": "Doe, Jane", "ArtifactID": 1023652, "Guids": [] }, "LastModifiedOn": "2019-03-06T19:53:06.413", "Meta": { "Unsupported": [], "ReadOnly": [] }, "Actions": [ { "Name": "Delete", "Href": "Relativity.MassOperations/workspace/2342954/massoperations/1042616", "Verb": "DELETE", "IsAvailable": true, "Reason": [] }, { "Name": "Update", "Href": "Relativity.MassOperations/workspace/2342954/eventhandlermassoperations/1042616", "Verb": "PUT", "IsAvailable": true, "Reason": [] } ], "ArtifactID": 1042616, "Guids": [] }
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.
To update a custom page mass operation, send a PUT request to the following URL:
<host>/Relativity.REST/api/Relativity.MassOperations/workspace/{{workspaceId}}/custompagemassoperations/{{massOperationId}}
The body of the request must contain the following fields unless specifically identified as optional:
{ "MassOperationRequest": { "Name": "Updated custom page mass operation", "RelativityApplications": [ { "ArtifactID":1042630, "Guids":[] } ], "Url": "https://www.mydomain.corp/MySite/Content/MyCustomPage.htm", "PopupHeight": 500, "PopupWidth": 500, "LastModifiedOn": "2019-03-11T19:00:53.317" } }
To update an event handler mass operation, send a PUT request to the following URL:
<host>/Relativity.REST/api/Relativity.MassOperations/workspace/{{workspaceId}}/eventhandlermassoperations/{{massOperationId}}
The body of the request must contain the following fields unless specifically identified as optional:
{ "MassOperationRequest":{ "Name":"Updated event handler mass operation", "RelativityApplications":[ ], "EventHandlerID":"3717", "Layout":{ "Value":{ "ArtifactID":1042377, "Guids":[ ] } }, "LastModifiedOn":"2019-03-14T19:30:52.35" } }
When a mass operation is successfully updated, the response returns a status code of 200.
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.
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.
[ { "Name":"Document", "ArtifactTypeID":10, "ArtifactID":1035231, "Guids":[ ] }, { "Name":"Transform Set", "ArtifactTypeID":1000004, "ArtifactID":1035285, "Guids":[ ] }, { "Name":"Transform", "ArtifactTypeID":1000005, "ArtifactID":1035296, "Guids":[ ] }, { "Name":"Search Terms Report", "ArtifactTypeID":1000006, "ArtifactID":1035313, "Guids":[ ] } ]
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.
The response contains the following fields:
[ { "Application":{ "Name":"Custom Test Application", "ArtifactID":0, "Guids":[ "5a4d89fc-7ec9-4a37-99ca-2a4d94ba4f02" ] }, "EventHandlerID":3717, "AssemblyName":"Test.Package.dll", "ClassName":"Test.Relativity.EventHandlers.MassOperations.GenerateExcelTextHandler", "CompanyName":"TEST", "Description":"" }, { "Application":{ "Name":"Case Dynamics", "ArtifactID":0, "Guids":[ "5975ec2c-ef13-4358-a062-aff4891b2343" ] }, "EventHandlerID":16685, "AssemblyName":"kCura.CaseDynamics.EventHandlers.dll", "ClassName":"kCura.CaseDynamics.EventHandlers.PrintingProfile.PrintingProfile_MassDelete", "CompanyName":"Relativity ODA LLC", "Description":"Printing Profile Mass Delete Custom" }, { "Application":{ "Name":"Document Utilities", "ArtifactID":0, "Guids":[ "6894df96-b204-4157-9318-4073d8a7476d" ] }, "EventHandlerID":16276, "AssemblyName":"MoveDocumentsToFolder_EH.dll", "ClassName":"MoveDocumentsToFolder_EH.MassOperation", "CompanyName":"Relativity ODA LLC", "Description":"Mass operation to move documents to a folder path specified in a text field." } ]
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.
The body of the request contains the following fields:
Note: You can specify a value for only one of these fields: Name, ArtifactID, or ArtifactTypeID. The other fields are then optional.
{ "ObjectType":{ "ArtifactID":1042378, "ArtifactTypeID":1000048, "Guids":[ ], "Name":"Custom Object Type" } }
The response contains the following fields:
[ { "ObjectTypeName":"Custom Object Type", "Name":"Custom Object Type Layout", "ArtifactID":1042377, "Guids":[ ] }, { "ObjectTypeName":"Custom Object Type", "Name":"Custom Layout", "ArtifactID":1042594, "Guids":[ ] }, { "ObjectTypeName":"Custom Object Type Two", "Name":"Custom Object Type Two Layout", "ArtifactID":1042579, "Guids":[ ] }, { "ObjectTypeName":"Custom Page", "Name":"Custom Page Layout", "ArtifactID":1036937, "Guids":[ ] }, { "ObjectTypeName":"Data Grid Audit", "Name":"Data Grid Audit Layout", "ArtifactID":1038060, "Guids":[ ] }, { "ObjectTypeName":"Data Grid Audit Field Mapping", "Name":"Data Grid Audit Field Mapping Layout", "ArtifactID":1038061, "Guids":[ ] } ]
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 |