Makes location the caller's profile's active media storage location, where new record media is written, together with its folder and structure.
location |
Needs | destination_root |
Stored as |
|---|---|---|---|
2 Dropbox |
a Dropbox connection | optional folder path | the path as sent |
3 Box |
a Box connection on a paid Box plan | optional folder path | the id of the last folder; missing folders are created |
5 S3 |
the server's media bucket | not sent | - |
6 OneDrive |
a OneDrive connection | optional folder path | the path as sent |
7 SharePoint |
a SharePoint connection and site_id |
required document library name | the library name; the library is created on the site if missing, and site_id is stored on the connection |
8 Google Drive |
a Google Drive connection | optional folder path | the id of the last folder; missing folders are created |
9 S3 (private) |
the server's private media bucket | not sent | - |
structure is 0 (the default: root / profile id / form name / file) or 1 (root / file).
Every provider call is made before anything is stored, and the location, folder and structure are then written together, so a provider failure leaves the profile's media storage exactly as it was. Any location may be chosen by any account; there is no plan or account-type restriction beyond Box's own paid-plan requirement.
Authorization
Internal clients only, and a SERVER or COMPANY user.
Body
Required
-
Values are
2,3,5,6,7,8, or9. -
the folder path (a document library name for SharePoint); not used for 5 and 9
Maximum length is
255. -
0 = root / profile id / form name / file, 1 = root / file
Values are
0or1. Default value is0. -
SharePoint (7) only, required there;
rootor anidfromGET /media_storage/connections/7/sites
Responses
-
OK - the location is now the profile's active media storage location.
-
Bad Request -
locationis not one of 2, 3, 5, 6, 7, 8, 9;structureis not 0 or 1;destination_rootis not a string, is longer than 255 characters, holds a control character or a./..segment, holds whitespace or any of" * : < > ? \ |for location 6, 7 or 8, is sent for location 5 or 9, or is missing or more than one library name for location 7;site_idis missing or not a site id for location 7, or sent for another location; or location 5 or 9 has no S3 bucket configured on this server. -
Unauthorized - missing or invalid bearer token.
-
Forbidden - the client is not an internal client, or the token belongs to a BASIC user.
-
Conflict - the profile has no connection for
location(2, 3, 6, 7, 8); connect it first withPOST /media_storage/connections. Also returned when the provider grant must be reconnected. -
Unprocessable Entity - Box only; the Box account is not on a paid plan (its upload limit is under 1 GB).
-
Bad Gateway - the provider failed while the folder or library was being found or created. Nothing was changed.
curl \
--request PUT 'https://api.iformbuilder.com/exzact/api/v81/[servername]/media_storage/active' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer {access_token}" \
--data '{
"location": 7,
"destination_root": "iFormMedia",
"structure": 0,
"site_id": "contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE"
}'
{
"location": 7,
"destination_root": "iFormMedia",
"structure": 0,
"site_id": "contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE"
}
{
"provider": "box",
"location": 3,
"active": true,
"destination_root": "163842097521",
"account": "Ops Team"
}
{
"provider": "s3_private",
"location": 9,
"active": true
}