跳到主要内容

setFolderValues

EntryMetadataWrapper setFolderValues(folderId, SetMetadataValues)

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

Set folder metadata values

Writes the values of metadata fields on a folder or a room. The caller needs the right to edit the folder; for a room that is its manager. Every field must belong to a template the folder carries, assigned with PUT api/2.0/files/metadata/folder/{folderId}/templates or inherited from a cascading folder, and a field may be listed once. A value carries exactly the member of its type: stringValue for a text field of at most 8000 characters, numberValue for a number, dateValue for a date, optionIds for a choice field; an empty value clears the field. A date without a time zone offset is read as UTC. The write finishes in the request and touches the folder only: to push the new values down a cascading folder run the cascade again with Overwrite, while entries created or moved in later take them on their own. The custom text fields are written with PUT api/2.0/files/metadata/folder/{folderId}/customFields instead. The answer is the whole metadata of the folder after the write. A value of the wrong type, a field listed twice, a custom field or a field of a template the folder does not carry is answered with 400; a folder the caller cannot edit with 403; a folder or a field that does not exist with 404.

Parameters​

NameInTypeDescriptionNotes
folderIdpathInteger (int32)The folder ID.[required] [example: 1]
SetMetadataValuesbodySetMetadataValuesThe parameters for setting values.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The metadata of the folder after the write: the assigned templates with the values of their fields, and the custom fieldsEntryMetadataWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400A value does not match the field type, a field is listed twice or is a custom field, or the field belongs to a template the folder does not have--
403You don't have enough permission to perform the operation--
404The folder or a field 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​

EntryMetadataWrapper

Authorization​

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

HTTP request headers​

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