跳到主要内容

setDefaultTemplate

DefaultTemplateSettingsWrapper setDefaultTemplate(DefaultTemplateSettingsRequestDto)

PUT /api/2.0/files/settings/defaulttemplate

Change the default template setting

Makes an existing document the blank the portal creates for one extension, and returns the full set of templates as it now stands. The file is copied into the portal's template storage, so later edits of the original do not change the blank, and the file that served as the previous custom blank for that extension is deleted. selectedFile takes the identifier of a file the caller may copy - a number for a document stored in the portal, a string for one in a connected third-party storage - and its extension must be the one named in fileExtension; a mismatch or an identifier of another kind answers 400, a file the caller may not copy answers 403, and a file that is not there is answered as missing. An extension the built-in template set does not cover is not an error: the call succeeds and changes nothing, so compare the answer with what was asked for. Requires the portal settings permission.

Parameters​

NameInTypeDescriptionNotes
DefaultTemplateSettingsRequestDtobodyDefaultTemplateSettingsRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The blank document configured for each supported extension after the changeDefaultTemplateSettingsWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no selectedFile or fileExtension, the file identifier is of an unsupported kind, or its extension is not the one requested--
403The caller has no portal-settings right, or may not copy the selected file--
404The selected file does not exist--
500The file identifier is a number that cannot be read as a 32-bit integer: fractional, in exponent notation or out of range--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
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​

DefaultTemplateSettingsWrapper

Authorization​

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

HTTP request headers​

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