DocumentLibrarySettings - Huddle/huddle-apis GitHub Wiki
This API allows workspace managers to view and edit settings which affect all the files and folders in a workspace. You can obtain the link for this resource from a folder in the workspace.
Issue a GET request to the document-library-settings
URI from a Folder resource.
GET ... HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"links": [
{ "rel": "self", "href": "..." },
{ "rel": "document-library", "href": "..." }
],
"membersMayCreateFolders": true,
"documentPublicationEnabled": true
}
GET ... HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<documentLibrarySettings>
<links>
<link rel="self" href="..." />
<link rel="documentLibrary" href="..." />
</links>
<membersMayCreateFolders>true</membersMayCreateFolders>
<documentPublicationEnabled>true</documentPublicationEnabled>
</documentLibrarySettings>
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 |
---|---|
membersMayCreateFolders |
true or false |
documentPublicationEnabled |
true or false |
GET /files/workspaces/31395/folders/root/settings/edit HTTP/1.1
Content-Type: application/vnd.huddle.data+json
Accept: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"membersMayCreateFolders": false,
"documentPublicationEnabled": false
}
PUT /files/workspaces/31395/folders/root/settings/edit HTTP/1.1
Content-Type: application/vnd.huddle.data+json
Accept: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
{
"membersMayCreateFolders": false,
"documentPublicationEnabled": false
}
HTTP/1.1 204 No Content
Content-Type: application/vnd.huddle.data+json
Link: </files/workspaces/31395/folders/root/settings/>;rel="parent"
GET /files/workspaces/31395/folders/root/settings/edit HTTP/1.1
Content-Type: application/vnd.huddle.data+xml
Accept: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
<documentLibrarySettings>
<membersMayCreateFolders>false</membersMayCreateFolders>
<documentPublicationEnabled>false</documentPublicationEnabled>
</documentLibrarySettings>
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<documentLibrarySettings>
<links>
<link rel="self" href="..." />
<link rel="documentLibrary" href="..." />
</links>
<membersMayCreateFolders>false</membersMayCreateFolders>
<documentPublicationEnabled>false</documentPublicationEnabled>
</documentLibrarySettings>
PUT /files/workspaces/31395/folders/root/settings/edit HTTP/1.1
Content-Type: application/vnd.huddle.data+xml
Accept: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
<documentLibrarySettings>
<membersMayCreateFolders>false</membersMayCreateFolders>
<documentPublicationEnabled>false</documentPublicationEnabled>
</documentLibrarySettings>
HTTP/1.1 204 No Content
Content-Type: application/vnd.huddle.data+xml
Link: </files/workspaces/31395/folders/root/settings/>;rel="parent"
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 |
start |= documentLibrarySettings
documentLibrarySettings = element h:documentLibrarySettings {
element h:links {
link *
},
element h:membersMayCreateFolders { text },
element h:documentPublicationEnabled { text }
}