Troubleshoot REST API errors

Use the information in the following sections to troubleshoot operations performed through the REST API.

HTTP method fails

The REST API returns a message in the JSON response when an error occurs during an operation. For example, you execute a GET request which does not support the start parameter as illustrated here:

GET http://localhost/Relativity.REST/Workspace/1017955/Document/QueryResult?start=12        

The operation returns a status code of 400, and the response contains the message:

{
     "Message":"There is an invalid parameter in the query string: start"
}        

If you perform a GET for a Document that doesn't exist, as illustrated here:

GET http://localhost/Relativity.REST/Workspace/1017955/Document/1234567        

The operation returns a status code of 404, and the response contains the message:

{
     "Message":"Artifact cannot be found."
}        

Incorrect maxRequestLength parameter

If a Relativity.REST API operation contains a very large payload, for example, a saved search with long search string or a complex set of set of conditions, the operation may fail with a status code of 400 and the following message:

"Maximum request length exceeded. Request content length:{0} > Max request length:{1}"

This issue occur if the maximum request length for the service is set to a low value. The error may be resolved by increasing the value of the maxRequestLength parameter in the httpRuntime section of the Relativity.REST web.config file. For more information about the option, see MSDN documentation.The default value is 4096 (4 MB).

On a developer test VM, you can correct this issue by editing the maxRequestLength parameter in the Relativity.Services.ServiceHost.exe.config file. This file is available in the following locations:

  • C:\Program Files\kCura Corporation\Relativity\ServiceHost\bin directory
  • C:\Program Files\kCura Corporation\Relativity\ServiceHost directory

Set the maxRequestLength parameter as follows:

<system.web>
     <httpRuntime maxRequestLength="32768"/>
</system.web>

For more information, see HTTP status codes in Relativity REST APIs.

Unable to update or delete resources

The inability to update or delete a resource through the REST API may be caused by an incorrect setting for WebDAVModule in the Relativity.REST web.config file. Complete these steps to resolve this issue:

  1. Open the web.config file in a text editor.
  2. Locate the <modules> section in the file.
  3. Verify that the file settings explicitly remove the WebDAVModule. If necessary, update your file to match the following code sample:
    <modules runAllManagedModulesForAllRequests="true">
         <remove name="WebDAVModule" />
    </modules>