Processing Filter Manager service in REST

Processing filters provide functionality to view and select processed documents before publishing them to Relativity. The Processing Filter Manager service exposes endpoints for programmatically creating, updating, and deleting filters. It supports applying these filters to data and retrieving the filtered data. Additionally, this service exposes helper endpoints for retrieving filters associated with a data source or available in a specific workspace. For more general information, see Filtering data on the Relativity 9.6 site.

As a sample use case, you may want to implement a simplified processing workflow by programmatically adding complex criteria to filters applied to processing jobs in Relativity. This approach eliminates the need to manually enter filter criteria through the UI, which may be time consuming and error prone. Similarly, you can also use the Processing Filter Manager service to modify the settings on these or other complex filters implemented in your environment.

The Processing Filter Manager service also supports the same functionality through .NET. For more information, see Processing Filter Manager API.

This page contains the following information:

Client code sample

To use the Processing Filter Manager service, send POST requests using the required endpoint. See the following base URL for this service:

<host>/Relativity.Rest/api/Relativity.Processing.Services.IProcessingModule/Processing%20Filter%20Manager/

You can use the following .NET code as a sample client for deleting a processing filter or for performing other operations. This code illustrates how to perform the following tasks:

//Set up the client.
HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = new Uri("http://localhost/");
    
//Set the required headers.
httpClient.DefaultRequestHeaders.Add("X-CSRF-Header", "-");
httpClient.DefaultRequestHeaders.Add("Authorization", "Basic bXkudXNlckBrY3VyYS5jb206Q250VGNoVGhzMTIzNCE=");
    
//Call the operation that you want to run.
string url = "Relativity.REST/api/Relativity.Processing.Services.IProcessingModule/Processing Filter Manager/DeleteFilterAsync”;
StringContent content = new StringContent(QueryInputJSON);
content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
HttpResponseMessage response = httpClient.PostAsync(url, content).Result;
string result = response.Content.ReadAsStringAsync().Result;
bool success = HttpStatusCode.Ok == response.StatusCode;
    
//Parse the result with Json.NET.
JObject resultObject = JObject.Parse(result);

Guidelines for the Processing Filter Manager service

Review the following guidelines for working with this service.

Access rights

Verify that you have access to the workspace where you want make calls to the Processing Filter Manager service.

Helper endpoints

Use the GetFilterByDataSourceAsync or GetFiltersAsync helper endpoints to get the name, identifier, and type for a filter. See Retrieve processing filters and Retrieve processing filters for a data source.

Filter expressions

To create or update a processing filter, use the expression types, operators, and properties supported by the Processing Filter Manager service for this purpose. For more information on objects used to build expressions, see Processing Filter Manager API.

Expression types

The following types of expressions are supported:

Operators

The following operators are supported in expressions:

Properties

Click the following drop-down link to view a list of properties supported for use in expressions.

Create a processing filter

Use the CreateExpressionFilterAsync endpoint to add a new processing filter to Relativity. Send a POST request to the following URL:

<host>/Relativity.Rest/api/Relativity.Processing.Services.IProcessingModule/Processing%20Filter%20Manager/CreateExpressionFilterAsync

The body of the request must contain the following fields unless specifically identified as optional:

{
    "request":
    {
        "WorkspaceArtifactId" : 1021524,
        "FilterName" : "FileIdNot123",
        "DataSourceArtifactIds": [1042573],
        "Expression" : "{
            \"Type\" : \"EmptyExpression\",
            \"Property\" : \"FileId\",
            \"Constraint\" : \"IsNot\",
            \"Value\" : 123
        }",
        "IncludeFamily": "true"
    }
}

The response contains the following fields:

{
    "FilterId": 10,
    "FilterName": "FileIdNot1",
    "Type": "Expression"
}

Apply a processing filter

To apply a filter to the documents in a data set, send a POST request to the following URL:

<host>/Relativity.Rest/api/Relativity.Processing.Services.IProcessingModule/Processing%20Filter%20Manager/ApplyFilterAsync

The body of the request must contain the following fields unless specifically identified as optional:

{
    "request":
    {
        "WorkspaceArtifactId" : 1021524,
        "FilterId" : 10,
        "Priority": 100
    }
 
}

When the request is successful, the response contains a value of type long, which is the ID for the job that was executed.

{
    13242 
}

Update a processing filter

To modify a processing filter, send a POST request to the following URL:

<host>/Relativity.Rest/api/Relativity.Processing.Services.IProcessingModule/Processing%20Filter%20Manager/UpdateExpressionFilterAsync

The body of the request must contain the following fields unless specifically identified as optional:

{
    "request":
    {
        "WorkspaceArtifactId" : 1021524,
        "FilterName" : "My Filtered Files",
        "FilterId" : 3,
        "DataSourceArtifactIds": [1042573],
        "Expression" : "{
            \"Type\" : \"EmptyExpression\",
            \"Property\" : \"FileId\",
            \"Constraint\" : \"IsNot\",
            \"Value\" : 1
        }",
        "IncludeFamily": "true"
    }

The response contains the following fields:

{
    "FilterId": 3,
    "FilterName": "My Filtered Files",
    "Type": "Expression"
}

Delete a processing filter

Use the DeleteFilterAsync endpoint to remove a filter from Relativity. Send a POST request to the following URL:

<host>/Relativity.Rest/api/Relativity.Processing.Services.IProcessingModule/Processing%20Filter%20Manager/DeleteFilterAsync

The body of the request must contain the following fields unless specifically identified as optional:

{
    "request":
    {
        "WorkspaceArtifactId" : 1021524,
        "FilterId" : 8
    }
}

When the filter is successfully deleted, the response returns the status code of 200.

Retrieve document metadata

You can retrieve available metadata for a specific document. Send a POST request to the following URL:

<host>/Relativity.Rest/api/Relativity.Processing.Services.IProcessingModule/Processing Document Manager/GetDocumentMetadataAsync

The body of the request must contain the following fields unless specifically identified as optional:

{
    "request":
    {
        "ProcessingFileId" : 9,
        "WorkspaceArtifactId" : 1000000
    }
}

The response contains the following fields:

{ "ProcessingFileId": 9, "WorkspaceArtifactId": 1017804, "MetadataJson": "{\"Metadata\":{\"OracleFileID\":1999,\"OracleFileType\":\"Unknown format\",\"MediaType\":\"text/plain\"},\"DocMetadata\":{\"LastModified\":\"2017-12- 13T17:48:00.0478951Z\",\"CreatedOn\":\"1900-01-01T00:00:00Z\",\"LastAccessed\":\"1900-01-01T00:00:00Z\",\"LiteralFileExtension\":\"TXT\"}}", "Errors": [] }

Retrieve discovered documents

After you apply a processing filter, you can use the GetDiscoveredDocumentsAsync endpoint to retrieve the filtered discovered documents. Send a POST request to the following URL:

<host>/Relativity.Rest/api/Relativity.Processing.Services.IProcessingModule/Processing%20Filter%20Manager/GetDiscoveredDocumentsAsync

The body of the request must contain the following fields unless specifically identified as optional:

{
    "request":
    {
       "WorkspaceArtifactId" : 1017804,
       "Expression" : "{
        \"Type\" : \"ConditionalExpression\",
        \"Property\" : \"ProcessingFileId\",
        \"Constraint\" : \"IsNot\",
        \"Value\" : 2
     }",
    "StartingPointOfResult": 0,
    "NumberOfResults": 2,
    "SortingOptions": [ { "Property" : "ProcessingFileId", "Order": "Ascending" } ]
    }
}

Retrieve filtered data

After you apply a processing filter, you can use the GetFilterResultAsync endpoint to retrieve the filtered date. Send a POST request to the following URL:

<host>/Relativity.Rest/api/Relativity.Processing.Services.IProcessingModule/Processing%20Filter%20Manager/GetFilterResultAsync

The body of the request must contain the following fields unless specifically identified as optional:

{
    "request":
    {
        "WorkspaceArtifactId" : 1021524,
        "FilterId" : 6,
        "NumberOfResults" : 100,
        "StartingPointOfResult": 0
    }
}

Retrieve processing filters

You can retrieve all available processing filters for a specific workspace. Send a POST request to the following URL:

<host>/Relativity.Rest/api/Relativity.Processing.Services.IProcessingModule/Processing%20Filter%20Manager/GetFiltersAsync

The body of the request must contain the following fields unless specifically identified as optional:

{
    "request":
    {
        "WorkspaceArtifactId" : 1021524
    }
}

The response contains the following fields:

[
    {
        "FilterId": 2,
        "FilterName": "ConditionalTest",
        "Type": "Expression"
    },
    {
        "FilterId": 3,
        "FilterName": "Empty3files",
        "Type": "Expression"
    },
    {
        "FilterId": 1,
        "FilterName": "Emptyyy",
        "Type": "Expression"
    },
    {
        "FilterId": 6,
        "FilterName": "FileSizeGreaterThanBegins",
        "Type": "Expression"
    },
    {
        "FilterId": 5,
        "FilterName": "TextExtractionMethodBegins",
        "Type": "Expression"
    }
]

Retrieve processing filters for a data source

You can retrieve processing filters for a specific data source. Send a POST request to the following URL:

<host>/Relativity.Rest/api/Relativity.Processing.Services.IProcessingModule/Processing%20Filter%20Manager/GetFilterByDataSourceAsync

The body of the request must contain the following fields unless specifically identified as optional:

{
    "request":
    {
        "WorkspaceArtifactId" : 1021524,
        "DataSourceArtifactId": 1042573
    }
}

The response contains the following fields:

[
    {
        "FilterId": 2,
        "FilterName": "ConditionalTest",
        "Type": "Expression"
    },
    {
        "FilterId": 3,
        "FilterName": "Empty3files",
        "Type": "Expression"
    },
    {
        "FilterId": 6,
        "FilterName": "FileSizeGreaterThanBegins",
        "Type": "Expression"
    },
    {
        "FilterId": 5,
        "FilterName": "TextExtractionMethodBegins",
        "Type": "Expression"
    }
]

Pivot on discovered documents

After you apply a processing filter, you can use the PivotOnDiscoveredDocumentsAsync endpoint to retrieve filtered discovered documents on pivot. Send a POST request to the following URL:

<Host>/Relativity.Rest/api/Relativity.Processing.Services.IProcessingModule/Processing%20Filter%20Manager/PivotOnGetDiscoveredDocumentsAsync

The body of the request must contain the following fields unless specifically identified as optional:

When the request is successful, the response will return a List of GetDiscoveredDocumentsWithPivotOnResponse objects.

The response contains the following fields:

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