Workspace
A workspace resource represents a secure data repository for documents and applications developed with Dynamic Objects. It is an admin-level object.
Note:
This page contains the following information:
GET method
You can use the GET method to retrieve a single Workspace or a collection of Workspaces. You can find a general overview of this functionality in Retrieve resources and a detailed code sample in Create a simple .NET client.
Retrieve a Workspace
When you retrieve a single Workspace, you must supply a unique identifier (such as a GUID or ArtifactID) for the resource.
Sample URL
The URL contains the identifier for a Workspace resource. You don't need to provide a body with a GET request.
1 | /localhost/Relativity.REST/Relativity/Workspace/1015349 |
Code sample
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | //Set up the client. HttpClient httpClient = new HttpClient(); //Set the required headers. httpClient.DefaultRequestHeaders.Add( "X-CSRF-Header" , string .Empty); httpClient.DefaultRequestHeaders.Add( "Authorization" , "Basic c2FtcGxlYWRtaW5AcmVsYXRpdml0eS5yZXN0OlMwbTNwQHNzdzByZA==" ); //Call the GET method on a Workspace. string url = "Relativity.REST/Relativity/Workspace/1015349" ; HttpResponseMessage response = httpClient.GetAsync(url).Result; string result = response.Content.ReadAsStringAsync().Result; bool success = HttpStatusCode.OK == response.StatusCode; //Parse the result with Json.NET. JObject resultObject = JObject.Parse(result); |
Response
Retrieve a collection of Workspaces
You can retrieve a collection of Workspaces with the GET method.
Sample URL
The URL indicates that you are retrieving a collection of Workspace resources. You don't need to provide a body with this GET request.
1 | http: //localhost/Relativity.REST/Relativity/Workspace |
Code sample
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | //Set up the client. HttpClient httpClient = new HttpClient(); //Set the required headers. httpClient.DefaultRequestHeaders.Add( "X-CSRF-Header" , "-" ); httpClient.DefaultRequestHeaders.Add( "Authorization" , "Basic c2FtcGxlYWRtaW5AcmVsYXRpdml0eS5yZXN0OlMwbTNwQHNzdzByZA==" ); //Call the GET method on the Workspace collection. string url = "Relativity.REST/Relativity/Workspace" ; HttpResponseMessage response = httpClient.GetAsync(url).Result; string result = response.Content.ReadAsStringAsync().Result; bool success = HttpStatusCode.OK == response.StatusCode; //Parse the result with Json.NET. JObject resultObject = JObject.Parse(result); |
Response
POST method
You can use the POST method to perform complex queries on Workspaces. For more information, see Retrieve resources.
Query for a Workspace resource
You can set conditions used to query for a Workspace resource.
Sample URL
1 | /localhost/Relativity.REST/Relativity/Workspace/QueryResult |
Sample code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | //Set up the client. HttpClient httpClient = new HttpClient(); //Set the required headers. httpClient.DefaultRequestHeaders.Add( "X-CSRF-Header" , string .Empty); httpClient.DefaultRequestHeaders.Add( "Authorization" , "Basic c2FtcGxlYWRtaW5AcmVsYXRpdml0eS5yZXN0OlMwbTNwQHNzdzByZA==" ); //Call Query on a Workspace. string url = "Relativity.REST/Relativity/Workspace/QueryResult" ; StringContent content = new StringContent(QueryInputJSON, Encoding.UTF8, "application/json" ); HttpResponseMessage response = httpClient.PostAsync(url, content).Result; string result = response.Content.ReadAsStringAsync().Result; bool success = HttpStatusCode.Created == response.StatusCode; //Parse the result with Json.NET. JObject resultObject = JObject.Parse(result); |
Request
Response