Getting Accessible Workspaces
Please read the Material Usage Rules on this site.
Description: The operation retrieves the list of workspaces accessible to the current user. This information is required to execute most subsequent queries.
Request parameters:
| Parameter | Type | Format | Default | Description |
|---|---|---|---|---|
| start | integer | int32 | (empty) | Start index for pagination. |
| total | integer | int32 | (empty) | Maximum number of results to return. |
| id | integer | int64 | (empty) | Optional workspace ID filter. |
| name | string | (empty) | Optional workspace name filter. | |
| roles | string | (empty) | Optional roles filter. |
Example request:
GET
CURL:
curl 'http://localhost:8160/v1/workspaces?start=0&total=1000&id=1&name=ApiEntity&roles=Owner' \
--header 'Api-Token: YOUR_SECRET_TOKEN'
C#:
using System.Text;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("http://localhost:8160/v1/workspaces?start=0&total=1000&id=1&name=ApiEntity&roles=Owner"),
Headers =
{
{ "Api-Token", "YOUR_SECRET_TOKEN" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
Cube:
http://localhost:8160/v1/workspaces?start=0&total=1000&id=&name=&roles=

Additionally:
User-Agent: {-Profile.UserAgent-}
Api-Token: Token from UserArea2.

Response API:
| Response code | Result |
|---|---|
200 OK | OK |
401 Unauthorized | Unauthorized |
403 Forbidden | Forbidden |
500 Internal Server Error | Internal Server Error |
Success Response (200 OK):
{
"totalCount": 1,
"items": [
{
"workspaceId": 1,
"name": "Sample Name",
"role": "string"
}
]
}
Error Response (500):
{
"message": null
}