Skip to content

DocumentLibrarySettings

Nur Aina Shazwani Zakaria edited this page Feb 12, 2025 · 12 revisions

Summary

This API allows workspace managers to view and edit settings which will affect all the files and folders privileges in a workspace.

Operations

Operation
Retrieve document library settings
Editable document library settings

Retrieve document library settings

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).

Example (JSON)

In this example, we request the document-library-settings for workspace 12345.

Request

GET /files/workspaces/12345/folders/root/settings HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty

Response

HTTP/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,
  "documentDifferenceEnabled": true,
  "officeOnlineEnabled": true,
  "downloadEnabled": true,
  "printEnabled": true
}

Example (XML)

Request

GET /files/workspaces/12345/folders/root/settings HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty

Response

HTTP/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="documentLibrary" href="files/workspaces/12345/folders/root" />
        <link rel="edit" href="files/workspaces/12345/folders/root/settings/edit" />
    </links>
    <membersMayCreateFolders>true</membersMayCreateFolders>
    <documentDifferenceEnabled>true</documentDifferenceEnabled>
    <officeOnlineEnabled>true</officeOnlineEnabled>
    <downloadEnabled>true</downloadEnabled>
    <printEnabled>true</printEnabled>
</documentLibrarySettings>

Link relations

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, PUT
edit The URI of the editable document library settings GET, PUT

Editable document library settings

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
documentDifferenceEnabled true or false
officeOnlineEnabled true or false
downloadEnabled true or false
printEnabled true or false

Example (JSON)

In this example, we modify the value of document library settings for workspace 12345

Request

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: OAuth2 frootymcnooty/vonbootycherooty

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
    "membersMayCreateFolders": true,
    "documentDifferenceEnabled": true,
    "officeOnlineEnabled": true,
    "downloadEnabled": true,
    "printEnabled": true
}

Request

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: OAuth2 frootymcnooty/vonbootycherooty
{
    "membersMayCreateFolders": false,
    "documentDifferenceEnabled": false,
    "officeOnlineEnabled": false,
    "downloadEnabled": false,
    "printEnabled": false
}

Response

HTTP/1.1 204 No Content
Content-Type: application/vnd.huddle.data+json
Link: </files/workspaces/12345/folders/root/settings/>;rel="parent"

Example (XML)

Request

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: OAuth2 frootymcnooty/vonbootycherooty

Response

HTTP/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="documentLibrary" href="files/workspaces/12345/folders/root" />
        <link rel="edit" href="files/workspaces/12345/folders/root/settings/edit" />
    </links>
    <membersMayCreateFolders>true</membersMayCreateFolders>
    <documentDifferenceEnabled>true</documentDifferenceEnabled>
    <officeOnlineEnabled>true</officeOnlineEnabled>
    <downloadEnabled>true</downloadEnabled>
    <printEnabled>true</printEnabled>
</documentLibrarySettings>

Request

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: OAuth2 frootymcnooty/vonbootycherooty
<documentLibrarySettings>
    <membersMayCreateFolders>false</membersMayCreateFolders>
    <documentDifferenceEnabled>false</documentDifferenceEnabled>
    <officeOnlineEnabled>false</officeOnlineEnabled>
    <downloadEnabled>false</downloadEnabled>
    <printEnabled>false</printEnabled>
</documentLibrarySettings>

Response

HTTP/1.1 204 No Content
Content-Type: application/vnd.huddle.data+xml
Link: </files/workspaces/12345/folders/root/settings/>;rel="parent"

Schema

start |= documentLibrarySettings

documentLibrarySettings = element h:documentLibrarySettings {
    element h:links {
        link *
    },
    element h:membersMayCreateFolders { text },
    element h:documentDifferenceEnabled{ text },
    element h:officeOnlineEnabled { text },
    element h:downloadEnabled { text },
    element h:printEnabled { text }
}
Classic
Clone this wiki locally