跳到主要内容

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 create in the folder (a room manager or a content creator); for a room that is its manager. The assignment 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, and the answer is that pass with the templateIds it propagates. 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. Without a cascade the answer is a completed operation without an identifier; a template that already cascades keeps cascading, it is turned off with PUT api/2.0/files/metadata/folder/{folderId}/templates/{templateId}. A caller without the right to create in the folder 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 create in the folder, or is not the manager of the room--
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