跳到主要内容

changeExternalSharingSettings

ExternalSharingSettingsWrapper changeExternalSharingSettings(ExternalSharingSettingsRequestDto)

PUT /api/2.0/files/settings/externalsharingsettings

Configure external sharing

Writes the portal's whole external-sharing policy in one request and returns the set that is now in force. Only the portal owner and a DocSpace administrator may call it; everyone else is refused, including an unauthenticated caller. Every field of the request is applied, so send the complete set rather than the field being changed - an omitted boolean is read as false. The portal keeps the set consistent: with externalShare false the default link type is forced to users of this portal only and sharing on social networks is turned off, and the three restriction fields only matter while external sharing is off. blockExistingLinksOnRestrict decides what happens to links that already exist, so it is the field that changes access to data already shared. The new set is pushed to the connected clients of the portal as well, and is published field by field by GET api/2.0/files/settings. Sending the same set again is safe.

Parameters​

NameInTypeDescriptionNotes
ExternalSharingSettingsRequestDtobodyExternalSharingSettingsRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The external sharing policy that is now in forceExternalSharingSettingsWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
403The caller is not a DocSpace administrator--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
400Bad Request.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​

ExternalSharingSettingsWrapper

Authorization​

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

HTTP request headers​

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