Skip to main content

assignFolderTemplates

MetadataOperationWrapper assignFolderTemplates(folderId, AssignMetadataTemplates)

PUT /api/2.0/files/metadata/folder/{folderId}/templates

Assign templates to a folder

Assigns one or more metadata templates to a folder or a room and, with cascade set, propagates them to every folder and file below it. The caller needs the right to edit the folder; for a room that is its manager. The assignment of the folder itself finishes in the request and writes no values. The cascade is asynchronous: a pass is queued that assigns the templates to the whole subtree and copies the values the folder holds for their fields, and the answer is the status of that pass. Poll GET api/2.0/files/metadata/folder/{folderId}/templates/progress until isCompleted is true; a failed pass reports its error there. The conflictResolveType decides what happens to a value an entry already holds: Skip keeps it, Overwrite replaces it with the folder's value. A folder inside the subtree that cascades the same template keeps its own values for its content. Entries created in or moved into the folder later inherit the templates and the values on their own. Without a cascade the answer is a completed operation without an identifier. A folder the caller cannot edit is answered with 403; a folder, or a template, that does not exist with 404.

Parameters​

NameInTypeDescriptionNotes
folderIdpathInteger (int32)The folder ID.[required] [example: 1]
AssignMetadataTemplatesbodyAssignMetadataTemplatesThe parameters for assigning templates.[required]

Responses​

Status codeDescriptionTypeResponse headers
200Cascade operation status; a completed operation without an ID when no cascade is requestedMetadataOperationWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no templateIds--
403The caller cannot edit the folder--
404The folder or one of the templates does not exist--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

MetadataOperationWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json