Skip to main content

saveThirdParty

ThirdPartyFolderWrapper saveThirdParty(ThirdPartyRequestDto)

POST /api/2.0/files/thirdparty

Connect a third-party account

Connects an account at a third-party storage service to the portal, or re-authenticates one that is already connected, and returns the folder that now stands for its root. Send providerId to update an existing account and omit it to connect a new one; the accepted providerKey values come from GET api/2.0/files/thirdparty/providers. The credentials to send depend on the service: the OAuth services take token, which is the authorization code from their consent screen and not an access token, while the WebDAV family and SharePoint take login with password, plus url where the server address is not fixed. Credentials are verified against the service before anything is stored, so a wrong password is refused and nothing is saved. The caller needs the rights to create rooms, and the portal-wide third-party switch has to be on, otherwise the call is refused. A new account is attached to the Rooms section and becomes available as room storage for POST api/2.0/files/rooms/thirdparty/{id}. Connecting twice with the same title creates two separate accounts.

Parameters​

NameInTypeDescriptionNotes
ThirdPartyRequestDtobodyThirdPartyRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The root folder of the connected accountThirdPartyFolderWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no customerTitle or providerKey, providerId is neither a number nor a numeric string, or, for a new account, providerKey names no known storage service or the token or password the service needs is missing--
403The caller cannot create rooms, the portal-wide third-party switch is off or no storage service is enabled, the title of a new account is empty once invalid characters are removed, the service rejects the credentials, or providerId names an account connected by another member--
404providerId names no third-party account on the portal--
500The storage service cannot be reached or fails while the credentials are checked--
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​

ThirdPartyFolderWrapper

Authorization​

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

HTTP request headers​

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