Workspaces

Last updated 27 days ago

Workspaces are the top-level organizational structure for folders and files. Workspaces are also a root_folder whose contents can be examined via the Folders endpoint.

post
Create a Workspace

https://ws-api.onehub.com
/workspaces
Creates a new Workspace owned by the user.
Request
Response
Body Parameters
name
optional
string
The name of the Workspace.
background_color
optional
string
A CSS hex color value that determines the background color for the Workspace.
data_room
optional
boolean
Activates Data Room mode for the Workspace. Defaults to false.
default_view
optional
string
Determines whether first time visitors should see folders and files displayed as horizontal rows or as a grid of large thumbnails. Defaults to rows.
200: OK
Returns the newly created Workspace object and a 200 if the call succeeds.
{
"workspace": {
"id": 4137,
"name": "Testing the API",
"background_color": "#58b28d",
"updated_at": "2016-01-25T16:39:34-08:00",
"data_room": false,
"default_view": "rows",
"default_sort": "alphabetical",
"root_folder_id": 849927,
"owner_id": 481,
"audit_trail": true,
"is_owner": true,
"require_agreement": false,
"agreement_accepted": false,
"effective_role": "Administrator",
"errors": {}
}
}

get
Read a Workspace

https://ws-api.onehub.com
/workspaces/:id
Retrieve the Workspace specified via :id.
Request
Response
Path Parameters
:id
required
integer
The unique identifier of the Workspace you would like to retrieve.
200: OK
Returns with Workspace object and a 200 if the call succeeds.
{
"workspace": {
"id": 4137,
"name": "Testing the API",
"background_color": "#58b28d",
"updated_at": "2016-01-25T16:39:34-08:00",
"data_room": false,
"default_view": "rows",
"default_sort": "alphabetical",
"root_folder_id": 849927,
"owner_id": 481,
"audit_trail": true,
"is_owner": true,
"require_agreement": false,
"agreement_accepted": false,
"effective_role": "Administrator",
"errors": {}
}
}
404: Not Found
Returns a 404 with an error in the message body if an invalid Workspace :id is provided.
//

put
Update a Workspace

https://ws-api.onehub.com
/workspaces/:id
Updates the Workspace specified via :id.
Request
Response
Path Parameters
:id
required
integer
The unique identifier of the Workspace you would like to update.
Body Parameters
name
optional
string
The name of the Workspace.
background_color
optional
string
A CSS hex color value that determines the background color for the Workspace.
data_room
optional
boolean
Activates Data Room mode for the Workspace. Defaults to false.
default_view
optional
string
Determines whether first time visitors should see folders and files displayed as horizontal rows or as a grid of large thumbnails. Defaults to rows.
200: OK
Returns the updated Workspace object and a 200 if the call succeeds.
{
"workspace": {
"id": 4137,
"name": "Testing the API",
"background_color": "#58b28d",
"updated_at": "2016-01-25T16:39:34-08:00",
"data_room": false,
"default_view": "thumbnails",
"default_sort": "alphabetical",
"root_folder_id": 849927,
"owner_id": 481,
"audit_trail": true,
"is_owner": true,
"require_agreement": false,
"agreement_accepted": false,
"effective_role": "Administrator",
"errors": {}
}
}

delete
Delete a Workspace

https://ws-api.onehub.com
/workspaces/:id
Delete the Workspace specified via :id.
Request
Response
Path Parameters
:id
required
integer
The unique identifier of the Workspace you would like to delete.
204: No Content
Returns an empty message body and a 204 if the call succeeds.
//

get
List all Workspaces

https://ws-api.onehub.com
/workspaces
List all Workspaces that the user has been invited to.
Request
Response
‚Äč
200: OK
Returns a paginated array of Workspace objects and a 200 if the call succeeds.
{
"current_page": 1,
"total_entries": 1,
"total_pages": 1,
"offset": 0,
"previous_offset": null,
"next_offset": null,
"per_page": 30,
"items": [
{
"workspace": {
"id": 4137,
"name": "Testing the API",
"background_color": "#58b28d",
"updated_at": "2016-01-25T16:54:00-08:00",
"data_room": false,
"default_view": "thumbnails",
"default_sort": "alphabetical",
"root_folder_id": 849587,
"owner_id": 481,
"audit_trail": true,
"is_owner": true,
"require_agreement": false,
"agreement_accepted": false,
"effective_role": "Administrator",
"errors": {}
}
}
]
}