Guided Upload Folder Shares
NOTE: The following functionality can only be taken advantage of when the New Link Experience & Dynamic Branding features are turned on. Please contact your account manager.
There ShareBase API offers the option to create guided upload shares, which are a special type of folder shares. These folder shares provide a curated user interface for share recipients, which is tailored to the needs of the user.
This type of folder share can be created via the ShareBase SDK by setting the ShareType
property of the SharedFolderOptions
class to ShareType.Template
. Please note, as the end user needs to have the ability see the UI and also upload content, the folder share should have both AllowView
and AllowUpload
enabled.
The following code is an example Console application which creates a guided upload folder share:
using Hyland.ShareBaseSdk;
using Hyland.ShareBaseSdk.Models;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace GuidedUploadFolderShareSample
{
/// <summary>
/// The following is an example of using the ShareBase SDK to create guided upload folder shares.
/// This is a special type of folder shares that uses a curated UI based on subfolders to guide users
/// during uploads.
/// NOTE: This functionality can only be taken advantage of when the New Link Experience & Dynamic Branding
/// features are turned on. Please contact your account manager.
/// </summary>
public class Program
{
static async Task<int> Main(string[] args)
{
if (args.Length < 2)
{
Console.WriteLine("Please enter the API address and a Bearer token.");
Console.WriteLine("Usage: GuidedUploadFolderShareSample <APIAddress> <BearerToken>");
return 0;
}
// Get the server address and the Bearer token
var apiAddress = args[0];
var bearerToken = args[1];
ILogger logger;
using (var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole().SetMinimumLevel(LogLevel.Trace)))
{
logger = loggerFactory.CreateLogger<ShareBaseClient>();
}
var client = new ShareBaseClient(apiAddress, bearerToken, "GuidedUploadFolderShareSample", "1.0", logger);
var libraries = await client.GetLibrariesAsync(new CancellationToken());
var library = libraries.First();
var guidedUploadRootTemplateFolderName = "Jane Doe 02262020";
var rootFolder = await client.CreateFolderPathAsync(library.LibraryId, guidedUploadRootTemplateFolderName, new CancellationToken());
var childFolders = new List<IShareBaseFolder>()
{
await client.CreateFolderPathAsync(library.LibraryId, $"{guidedUploadRootTemplateFolderName}\\Insurance Cards", new CancellationToken()),
await client.CreateFolderPathAsync(library.LibraryId, $"{guidedUploadRootTemplateFolderName}\\Other Car Damage", new CancellationToken()),
await client.CreateFolderPathAsync(library.LibraryId, $"{guidedUploadRootTemplateFolderName}\\Police Report", new CancellationToken()),
await client.CreateFolderPathAsync(library.LibraryId, $"{guidedUploadRootTemplateFolderName}\\Repair Quotes", new CancellationToken()),
await client.CreateFolderPathAsync(library.LibraryId, $"{guidedUploadRootTemplateFolderName}\\Your Car Damage", new CancellationToken())
};
logger.LogInformation("The folders have been created. Root folder: {RootFolderId}. Child folders: {ChildFolders}",
$"{rootFolder.FolderId} - {rootFolder.FolderName}", childFolders.Select(f => $"{f.FolderId} - {f.FolderName}"));
/// The <see cref="SharedFolderOptions.ShareType"/> must be <see cref="ShareType.Template"/> and both
/// <see cref="SharedFolderOptions.AllowView"/> and <see cref="SharedFolderOptions.AllowUpload"/> must be enabled.
var templateShare = await client.CreateFolderShareAsync(rootFolder.FolderId, new SharedFolderOptions()
{
AllowView = true,
AllowUpload = true,
ExpiresOn = DateTime.Now.AddDays(30),
ExpireStyle = ExpireStyle.Date,
ShareType = ShareType.Template,
AccessCodeRequired = false, // Set to true for access code protected shares https://developers.sharebase.com/share/
Recipients = new string[] { "sample-end-user@hyland.com" }
});
logger.LogInformation("Folder Shared successfully: {FolderShareWebLink}", templateShare.Links.WebUri);
logger.LogInformation("Template Folder Share Sample ended. Press any key to clean up the data and end the program . . .");
Console.ReadLine();
await client.PurgeFolderAsync(rootFolder.FolderId, new CancellationToken());
return 0;
}
}
}
This code creates a guided upload folder share for a folder with 5 subfolders tailored for an end user.
Upon visiting this share, the end user will be presented a dialog consisting of the library brand prompt for the corresponding library if applicable. After confirming they've read the prompt, the user will be presented with interactive buttons with names corresponding to sub folders within the share. These expose the ability to upload directly to that folder, meaning the folder name can tell the end user exactly what they need to upload. Once the user uploads a document to the folder, a check box will appear along with a badge stating the number of documents in the folder.
Example photos of the UI can be found on this API page: https://developers.sharebase.com/share/