跳到主要内容

updateTemplate

MetadataTemplateWrapper updateTemplate(templateId, UpdateMetadataTemplate)

PUT /api/2.0/files/metadata/templates/{templateId}

Update a metadata template

Renames a metadata template or changes whether it is shown in the pickers. Only a DocSpace admin can change templates. The request is partial: a property left out keeps its value, the fields are not touched here and are changed with PUT api/2.0/files/metadata/templates/{templateId}/fields/{fieldId}. The new name follows the rules of the creation: unique on the portal regardless of case and at most 255 characters. The answer is the whole template with its fields. A template that does not exist is answered with 404, a name already in use or too long with 400.

Parameters​

NameInTypeDescriptionNotes
templateIdpathInteger (int32)The template ID.[required] [example: 1]
UpdateMetadataTemplatebodyUpdateMetadataTemplateThe parameters for updating the template.[required]

Responses​

Status codeDescriptionTypeResponse headers
200Updated metadata templateMetadataTemplateWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400A template with this name already exists, or the name is too long--
403You don't have enough permission to perform the operation--
404Template not found--
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​

MetadataTemplateWrapper

Authorization​

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

HTTP request headers​

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