Waiting for engine...
Skip to main content

HTML/Java download tool and API using the short key

Upload tool that uses short key is available through the following URL:

https://thruservername/ExternalJavaDownload.aspx?ShortId=<shortIdValue>

Where shortIDValue is prepared in advance by the web service call

String GetDownloaderRequestKey (Guid SessionId, FTHDownloaderRequest request)

Which will be specified below and represents the following data structure:

FTHDownloaderRequest
{
public Guid SessionId,
public int[] FileIds,
public int[] FolderIds,
public string SuccessUrl,
public string ErrorReportingUrl
}

Structure fields:

  • SessionId: Identifier of the current session used for file download
  • FileIds (optional): Array of integer values that hold IDs of files to download.
note

Multiple files will be zipped on download if HTML (non-Java) download is used.

  • FolderIds (optional): Array of integer values that hold IDs of folders to download.
note

Folders will be zipped on download if HTML (non-Java) download is used.

  • SuccessUrl: Redirect browser window containing HTML download code or Java download applet to this URL if download is successful.

Page must be provided by the web application calling MFT FS API.

  • ErrorReportingUrl: Redirect browser window containing HTML download code or Java download applet to this URL if download failed.

Page must be provided by the web application calling MFT FS API.
If download failed, a server returns server error code using parameter ThruErrorCode.
If an error occurred and ErrorReportingUrl is not defined, then server throws unhandled exception in the upload page.
Error code is passed to error reporting page through ThruErrorCode URL parameter: ErrorReportingUrl?ThruErrorCode=<errorCode>

note

The value of ErrorReportingUrl is not validated. Ensure this is a valid URL.

Server error codes

The codes below are passed as a ThruErrorCode URL parameter to ErrorReportingUrl in case any error occurs as ErrorReportingUrl?ThruErrorCode=<errorCode>

  • Unknown error, information is not available.

  • SessionId is not a valid Guid variable.

  • Unknown SessionId. Supplied session identifier does not exist on the server

  • Array of FileId or FolderId contains an invalid ID integer value

  • Array of FileId or FolderId contains ID of the file or folder that does not exist

  • FileIds and FolderIds parameters are empty. Nothing to download

  • Download failed. This is generic error code returned for any unknown error in Download.

Sample File Upload API URL with short key:

[https://test.thruinc.net/ExternalJavaDownload.aspx?ShortId=NKBJH4TMDJBK1P2W1Y9O](https://test.thruinc.net/ExternalJavaDownload.aspx?ShortId=NKBJH4TMDJBK1P2W1Y9O)

Sample steps to work with File Upload API URL with short key: WDSL file for API version 4.0 is located at https://<servername>/ws4/fthservice.asmx?WSDL

  1. Get session id: 

    Open() or OpenImmutable() or other Open* calls in MFT FS API

  2. Get FileId(s) or/and FolderId(s) of the files that will be downloaded by using one of the file browsing or search methods.

  3. Provide SuccessUrl and ErrorReportingUrl and fill in the structure 

FTHDownloaderRequest

  1. Generate short key* ShortIdValue= GetDownloaderRequestKey (Guid SessionId, FTHDownloaderRequest request)*
  2. Compose View URL and open browser window with the link: 

https://<serverName>/ExternalJavaDownload.aspx?ShortId=<ShortIdValue>

Reference: Data structure to create ShortID for Download

FTHDownloaderRequest

Data TypeField NameSample ValueComments
GuidSessionId189BA074-F668-49CC-B7F6-330F4F89D755Session for file viewing
int[]FolderIdsArray of folders ids
int[]FileIdsArray of files ids
StringSuccessUrlhttp://success.comSuccess url
StringErrorReportingUrlhttp://error.comError url

Sample

<downloaderRequest><SessionId>310105b2-5d9c-437b-bbdc-be6651992ffb</SessionId><FileIds><int>1</int><int>2</int></FileIds><FolderIds><int>2</int><int>6</int></FolderIds><SuccessUrl>http://success.com</SuccessUrl><ErrorReportingUrl>http://error.com</ErrorReportingUrl></downloaderRequest>

Data transfer object

public class FTHDownloaderRequest
{
public Guid SessionId { get; set; }
public int[] FileIds { get; set; }
public int[] FolderIds { get; set; }
public string SuccessUrl { get; set; }
public string ErrorReportingUrl { get; set; }
}

Reference: Method GetDownloaderRequestKey

MethodString GetDownloaderRequestKey (Guid SessionId, FTHDownloaderRequest request)
DescriptionThe call accepts FTHDownloaderRequest object and returns shortID.
Request BodyFTHDownloaderRequest object
Return Data Objectstring
Invocation Scenario(s)
Remarks