Returns a temporary, expiring URL for a single file's thumbnail.
Only works for a file that already has a generated thumbnail. S-Drive generates thumbnails automatically for supported file types (documents, images, videos) when the Preview and Thumbnail feature is enabled — if a file has no thumbnail, this returns an error.
How to call this method
global static String getThumbnailURL(String parentId, String fileObjectId, Long timeValue)
global static String getThumbnailURL(String parentId, String fileObjectId, Long timeValue, Map<String,String> requestParameters)
Parameters
|
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
|
|
Yes |
Id of the parent object the file belongs to. Accepts both 15- and 18-character Salesforce Id formats. |
|
|
|
Yes |
Id of the file record to get a thumbnail URL for. To get an older version's thumbnail instead of the current one, pass that version's file record Id here. |
|
|
|
Yes |
How long the URL stays valid, in seconds. |
|
|
|
No |
Extra request parameters for the URL — most notably |
Return value
Returns a String — the URL for the file's thumbnail.
Example
String thumbnailURL = cg.SDriveTools.getThumbnailURL(acct.Id, fileId, 1 * 60); // expires in one minute