跳到主要内容

resetSmtpSettings

SmtpSettingsWrapper resetSmtpSettings()

DELETE /api/2.0/smtpsettings/smtp

Reset SMTP settings

Deletes the SMTP settings of this portal and puts it back on the mail configuration of the installation, so the portal stops using the relay saved by POST api/2.0/smtpsettings/smtp. Nothing has to be called first; the caller needs the portal-settings right of a DocSpace administrator, and the SMTP settings section has to be enabled for the portal, otherwise the call is answered with 402. The call is destructive and cannot be undone - the host, the sender identity and the credentials are gone and have to be entered again - but it is idempotent, and on a portal that has no settings of its own it changes nothing. Portal mail itself keeps working as long as the installation has a relay of its own configured. The answer holds the settings that are in force after the reset, always with isDefaultSettings true: the server-wide values in a standalone installation, an empty settings object in a cloud portal, and an empty credentialsUserPassword in both. Read them back at any time with GET api/2.0/smtpsettings/smtp.

Parameters​

This endpoint does not need any parameter.

Responses​

Status codeDescriptionTypeResponse headers
200The settings in force after the reset - the configuration of the installation, or an empty settings object in a cloud portalSmtpSettingsWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
402The SMTP settings section is not enabled for this portal--
403The caller has no portal-settings right--
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​

SmtpSettingsWrapper

Authorization​

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

HTTP request headers​

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