Matter Manager API

Matter Manager service exposes multiple endpoints that you can use to programmatically manage matters in your Relativity environment. It includes the following features:

  • Supports create, read, update, and delete operations on matters.
  • Provides helper endpoints used to retrieve available clients and statuses. Use these endpoints to determine the available clients and statuses with which to create or update matters.

You can also interact with the Matter Manager through the REST API. See Matter Manager service.

This page contains the following information:

GetAvailableClients

The following code sample illustrates how to get a list of the available clients using the GetAvailableClients_Async() method of the IMatterManager interface.

public static async Task GetAvailableClients_Async()
{
	int workspaceId = -1;

	using (Services.Interfaces.Matter.IMatterManager matterManager = serviceFactory.CreateProxy<Services.Interfaces.Matter.IMatterManager>())
	{
		try
		{
			List<DisplayableObjectIdentifier> response = await matterManager.GetAvailableClientsAsync(workspaceId);
			foreach (DisplayableObjectIdentifier client in response)
			{
				string info = string.Format("Read client {0} with Artifact ID {1}", client.Name, client.ArtifactID);
				Console.Write(info);
			}
		}
		catch (Exception ex)
		{
			Console.WriteLine(string.Format("An error occurred: {0}", ex.Message));
		}
	}
}

GetAvailableStatuses

The following code sample illustrates how to get a list of the available statuses using the GetAvailableStatuses_Async() method of the IMatterManager interface.

public static async Task GetAvailableStatuses_Async()
{
	int workspaceId = -1;

	using (Services.Interfaces.Matter.IMatterManager matterManager = serviceFactory.CreateProxy<Services.Interfaces.Matter.IMatterManager>())
	{
		try
		{
			List<DisplayableObjectIdentifier> response = await matterManager.GetAvailableStatusesAsync(workspaceId);
			foreach (DisplayableObjectIdentifier status in response)
			{
				string info = string.Format("Read status {0} with Artifact ID {1}", status.Name, status.ArtifactID);
				Console.Write(info);
			}
		}
		catch (Exception ex)
		{
			Console.WriteLine(string.Format("An error occurred: {0}", ex.Message));
		}
	}
}

Create

The following code sample illustrates how to create a task using the Task Create_Async() method of the IMatterManager interface.

public static async Task Create_Async()
{
	int workspaceId = -1;
	int clientId = 1015253;
	int statusId = 1016892;

	MatterRequest request = new MatterRequest
	{
		Name = "New Matter",
		Number = "10",
		Keywords = "keywords",
		Notes = "notes",
		Client = new Securable<ObjectIdentifier>(new ObjectIdentifier { ArtifactID = clientId }),
		Status = new Securable<ObjectIdentifier>(new ObjectIdentifier { ArtifactID = statusId })
	};

	using (Services.Interfaces.Matter.IMatterManager matterManager = serviceFactory.CreateProxy<Services.Interfaces.Matter.IMatterManager>())
	{
		try
		{
			int newMatterArtifactId = await matterManager.CreateAsync(workspaceId, request);
			string info = string.Format("Created matter with Artifact ID {0}", newMatterArtifactId);
			Console.Write(info);
		}
		catch (Exception ex)
		{
			Console.WriteLine(string.Format("An error occurred: {0}", ex.Message));
		}
	}
}

Read

The following code sample illustrates how to read a task using the Task Read_Async() method of the IMatterManager interface.

public static async Task Read_Async()
{
	int workspaceId = -1;
	int matterArtifactId = 1016911;

	using (Services.Interfaces.Matter.IMatterManager matterManager = serviceFactory.CreateProxy<Services.Interfaces.Matter.IMatterManager>())
	{
		try
		{
			MatterResponse response = await matterManager.ReadAsync(workspaceId, matterArtifactId);
			string info = string.Format("Read matter {0} with Artifact ID {1}", response.Name, response.ArtifactID);
			Console.Write(info);
		}
		catch (Exception ex)
		{
			Console.WriteLine(string.Format("An error occurred: {0}", ex.Message));
		}
	}
}

Update

The following code sample illustrates how to update a task using the Task Update_Async() method of the IMatterManager interface.

public static async Task Update_Async()
{
	int workspaceId = -1;
	int matterArtifactId = 1016911;
	int clientId = 1015253;
	int statusId = 1016892;

	MatterRequest request = new MatterRequest
	{
		Name = "New Matter",
		Number = "10",
		Keywords = "keywords",
		Notes = "notes",
		Client = new Securable<ObjectIdentifier>(new ObjectIdentifier { ArtifactID = clientId }),
		Status = new Securable<ObjectIdentifier>(new ObjectIdentifier { ArtifactID = statusId })
	};

	using (Services.Interfaces.Matter.IMatterManager matterManager = serviceFactory.CreateProxy<Services.Interfaces.Matter.IMatterManager>())
	{
		try
		{
			await matterManager.UpdateAsync(workspaceId, matterArtifactId, request);
		}
		catch (Exception ex)
		{
			Console.WriteLine(string.Format("An error occurred: {0}", ex.Message));
		}
	}
}

Delete

The following code sample illustrates how to delete a task using the Task Delete_Async() method of the IMatterManager interface.

public static async Task Delete_Async()
{
	int workspaceId = -1;
	int matterArtifactId = 1016911;

	using (Services.Interfaces.Matter.IMatterManager matterManager = serviceFactory.CreateProxy<Services.Interfaces.Matter.IMatterManager>())
	{
		try
		{
			await matterManager.DeleteAsync(workspaceId, matterArtifactId);
		}
		catch (Exception ex)
		{
			Console.WriteLine(string.Format("An error occurred: {0}", ex.Message));
		}
	}