As part of the Relativity Services API (RSAPI) Deprecation, content on this page refers to outdated information about using REST APIs for the RSAPI. For more information about alternative REST APIs, see the
RSAPI deprecation process.
Paging
When retrieving a collection of Artifacts, the REST API supports paging to maintain performance. All code that retrieves a collection of Artifacts through the REST API returns data in multiple pages. For example, the REST API supports paging on Document objects and RDOs to accommodate large results sets that Relativity queries may return. Paging parameters include the start index and page size.
For an initial query, you can specify only the pageSize as exemplified in the following URL:
1 | /Workspace/1015301/Document?pageSize=200
|
In a follow-up query, you can also specify the start index as well as the pageSize:
1 | /Workspace/1015301/Document?start=0&pageSize=1000
|
If you don't specify any paging parameters in the URL, the default value is used. You can find this value in the PDVDefaultQueryCacheSize setting of the Instance setting table in the EDDS database. By default, this instance setting is set to 10000. See Instance setting table on the Relativity Documentation site.
Sample POST operation using paging
When you perform paging with a POST operation, the response contains a JSON property called NextPage. This property is a link (that is a URL) to the subsequent page of results. For example, you perform a query using a POST with this URL:
1 | /localhost/Relativity.REST/Workspace/1017955/Document/QueryResult
|
View a JSON response containing the NextPage property
This JSON contains a URL to the next page of results.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | {
"ResultCount" : 10,
"Results" : [
{
"Artifact ID" : 1037184,
"Guids" : null ,
"Artifact Type ID" : 10,
"Artifact Type Name" : "Document" ,
"Artifact Type Guids" : [
"15c36703-74ea-4ff8-9dfb-ad30ece7530d"
],
"Parent Artifact" : {
"Artifact ID" : 1003697,
"Guids" : null ,
"Artifact Type ID" : null ,
"Artifact Type Name" : null ,
"Artifact Type Guids" : null ,
"__Location" : null
},
"Relativity Text Identifier" : "Big Bang" ,
"__Fields" : [
{
"Name" : "Relativity Text Identifier" ,
"Field Type" : "FixedLengthText" ,
"Field Guids" : null ,
"Field Artifact ID" : 0
}
]
},
...
],
"PreviousPage" : null ,
"QueryToken" : "d413d9ed-c343-4b89-8383-205133b773cf"
"TotalResultCount" : 11,
}
|
To retrieve the second page of results, you execute a GET operation with the URL provided in the NextPage property:
1 | /localhost/Relativity.REST/Workspace/1017955/Document/QueryResult/d413d9ed-c343-4b89-8383-205133b773cf?start=11&pageSize=10
|
View a JSON response for the second page of results
This JSON contains a URL to the previous page of results.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | {
"ResultCount" : 1,
"Results" : [
{
"Artifact ID" : 1046540,
"Guids" : null ,
"Artifact Type ID" : 10,
"Artifact Type Name" : "Document" ,
"Artifact Type Guids" : [
"15c36703-74ea-4ff8-9dfb-ad30ece7530d"
],
"Parent Artifact" : {
"Artifact ID" : 1003697,
"Guids" : null ,
"Artifact Type ID" : null ,
"Artifact Type Name" : null ,
"Artifact Type Guids" : null ,
"__Location" : null
},
"Relativity Text Identifier" : "123lkj" ,
"__Fields" : [
{
"Name" : "Relativity Text Identifier" ,
"Field Type" : "FixedLengthText" ,
"Field Guids" : null ,
"Field Artifact ID" : 0
}
]
}
],
"NextPage" : null ,
"QueryToken" : "d413d9ed-c343-4b89-8383-205133b773cf" ,
"TotalResultCount" : 11
}
|
Note: The previous and next page locations are empty on object types that don't support paging. For those object types, you can include paging parameters as part of the URL.