DocumentLibrarySettings - Huddle/huddle-apis GitHub Wiki
This API allows workspace managers to view and edit settings which will affect all the files and folders privileges in a workspace.
| Method | Path | Purpose | Details |
|---|---|---|---|
GET |
/files/workspaces/12345/folders/root/settings |
Retrieve document library settings | Jump |
GET |
/files/workspaces/12345/folders/root/settings/edit |
Editable document library settings | Jump |
This API request returns links for self, document-library, and edit (the edit link is provided only if the authenticated user has authorization to edit the document library settings).
In this example, we request the document-library-settings for workspace 12345.
GET /files/workspaces/12345/folders/root/settings HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherootyHTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json{
"links": [
{
"rel": "self",
"href": "/files/workspaces/12345/folders/root/settings"
},
{
"rel": "document-library",
"href": "/files/workspaces/12345/folders/root"
},
{
"rel": "edit",
"href": "/files/workspaces/12345/folders/root/settings/edit"
}
],
"membersMayCreateFolders": true,
"documentPublicationEnabled": true,
"documentDifferenceEnabled": true,
"officeOnlineEnabled": true,
"downloadEnabled": true,
"printEnabled": true
}GET /files/workspaces/12345/folders/root/settings HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: Bearer frootymcnooty/vonbootycherootyHTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml<documentLibrarySettings>
<links>
<link rel="self" href="/files/workspaces/12345/folders/root/settings" />
<link rel="document-library" href="/files/workspaces/12345/folders/root" />
<link rel="edit" href="/files/workspaces/12345/folders/root/settings/edit" />
</links>
<membersMayCreateFolders>true</membersMayCreateFolders>
<documentPublicationEnabled>true</documentPublicationEnabled>
<documentDifferenceEnabled>true</documentDifferenceEnabled>
<officeOnlineEnabled>true</officeOnlineEnabled>
<downloadEnabled>true</downloadEnabled>
<printEnabled>true</printEnabled>
</documentLibrarySettings>| Name | Description | Methods |
|---|---|---|
self |
The current URI of the document library settings |
GET, POST
|
document-library |
The URI of the document library to which these settings pertain | GET |
edit |
The URI of the editable document library settings |
GET, PUT
|
If the authenticated user is authorized to edit the document library settings, it will advertise a link with a @rel value of edit. To update it submit a PUT request to this URI with the settings you want to update. For an overview of editing resource in Huddle see editing resources.
If you omit a setting in your request, the current value for that setting will not be changed.
If you send an invalid setting in your PUT request, the server will respond with a 400 Bad Request status code.
| Setting name | Valid values | Notes |
|---|---|---|
membersMayCreateFolders |
true or false | |
documentPublicationEnabled |
true or false | Returns null if document publication is not enabled at the account level |
documentDifferenceEnabled |
true or false | |
officeOnlineEnabled |
true or false | |
downloadEnabled |
true or false | |
printEnabled |
true or false |
In this example, we modify the value of document library settings for workspace 12345
GET /files/workspaces/12345/folders/root/settings/edit HTTP/1.1
Content-Type: application/vnd.huddle.data+json
Accept: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherootyHTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json{
"membersMayCreateFolders": true,
"documentPublicationEnabled": true,
"documentDifferenceEnabled": true,
"officeOnlineEnabled": true,
"downloadEnabled": true,
"printEnabled": true
}PUT /files/workspaces/12345/folders/root/settings/edit HTTP/1.1
Content-Type: application/vnd.huddle.data+json
Accept: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty{
"membersMayCreateFolders": false,
"documentPublicationEnabled": false,
"documentDifferenceEnabled": false,
"officeOnlineEnabled": false,
"downloadEnabled": false,
"printEnabled": false
}HTTP/1.1 204 No Content
Link: </files/workspaces/12345/folders/root/settings/>;rel="parent"GET /files/workspaces/12345/folders/root/settings/edit HTTP/1.1
Content-Type: application/vnd.huddle.data+xml
Accept: application/vnd.huddle.data+xml
Authorization: Bearer frootymcnooty/vonbootycherootyHTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml<documentLibrarySettings>
<membersMayCreateFolders>true</membersMayCreateFolders>
<documentPublicationEnabled>true</documentPublicationEnabled>
<documentDifferenceEnabled>true</documentDifferenceEnabled>
<officeOnlineEnabled>true</officeOnlineEnabled>
<downloadEnabled>true</downloadEnabled>
<printEnabled>true</printEnabled>
</documentLibrarySettings>PUT /files/workspaces/12345/folders/root/settings/edit HTTP/1.1
Content-Type: application/vnd.huddle.data+xml
Accept: application/vnd.huddle.data+xml
Authorization: Bearer frootymcnooty/vonbootycherooty<documentLibrarySettings>
<membersMayCreateFolders>false</membersMayCreateFolders>
<documentPublicationEnabled>false</documentPublicationEnabled>
<documentDifferenceEnabled>false</documentDifferenceEnabled>
<officeOnlineEnabled>false</officeOnlineEnabled>
<downloadEnabled>false</downloadEnabled>
<printEnabled>false</printEnabled>
</documentLibrarySettings>HTTP/1.1 204 No Content
Link: </files/workspaces/12345/folders/root/settings/>;rel="parent"start |= documentLibrarySettings
documentLibrarySettings = element h:documentLibrarySettings {
element h:links {
link *
},
element h:membersMayCreateFolders { text },
element h:documentPublicationEnabled { text },
element h:documentDifferenceEnabled{ text },
element h:officeOnlineEnabled { text },
element h:downloadEnabled { text },
element h:printEnabled { text }
}
| Status Code | Reason |
|---|---|
| 401 | Invalid or missing authorization token |
| 403 | User is not a workspace manager, or the workspace or account is not active |
| 404 | Workspace does not exist |