Starts an OAuth connection between the caller's profile and a cloud storage provider. The API builds the consent URL with its own client id; the caller hosts only the redirect page and never sees a client secret or a provider token.
location |
Provider |
|---|---|
2 |
Dropbox (consent requests offline access, so a refresh token is issued) |
3 |
Box |
6 |
OneDrive |
7 |
SharePoint |
8 |
Google Drive |
redirect_uri must exactly match an entry of the server's mediaStorageRedirectUris configuration.
share: true (Box only) asks for the connection to be shared across the server's profiles. It is decided here and signed into state, so the exchange cannot change it; a caller who may not share gets 403 now, before the consent redirect.
Authorization
Internal clients only, and a SERVER or COMPANY user. share: true needs a SERVER user.
Responses
-
OK - open
consent_urlin the browser. The provider sends the user back toredirect_uriwithcodeandstate. -
Bad Request -
locationis not one of 2, 3, 6, 7, 8;shareis not a boolean or is true for a location other than 3; orredirect_uriis missing or not on this server'smediaStorageRedirectUrisallowlist. -
Unauthorized - missing or invalid bearer token.
-
Forbidden - the client is not an internal client, the token belongs to a BASIC user, or
shareis true and the user is not a SERVER user. -
Service Unavailable - the provider has no OAuth client credentials on this server.
curl \
--request POST 'https://api.iformbuilder.com/exzact/api/v80/[servername]/media_storage/connections/initiate' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer {access_token}" \
--data '{
"location": 3,
"redirect_uri": "https://app.example.com/integrations/callback",
"share": true
}'
{
"location": 3,
"redirect_uri": "https://app.example.com/integrations/callback",
"share": true
}
{
"consent_url": "https://www.dropbox.com/oauth2/authorize?response_type=code&client_id=abc123&redirect_uri=https%3A%2F%2Fapp.example.com%2Fintegrations%2Fcallback&force_reapprove=true&token_access_type=offline&state=eyJsb2NhdGlvbiI6Mn0.5d41402abc4b2a76b9719d911017c592",
"state": "eyJsb2NhdGlvbiI6Mn0.5d41402abc4b2a76b9719d911017c592"
}