Zoom Preview Server API

This section covers the API invocations related to previews and thumbnails in Zoom.

All JSON responses contain these standard fields:

“success” : “true|false”
“errorInfo” : “<Error msg if success is false, else this element will not be present>”
“errorCode”: A key that exists in the Zoom message catalog

Get Preview or Thumbnail

Description:
Get thumbnail or preview associated with an asset version.

Request URL:
http://192.168.1.6:8873/review/preview/assetPreview

If param “resolution” is absent or is set to 0, then the request just fetches a small thumbnail; otherwise, it fetches the preview at the specified resolution.If you specify the resolution as -1, it will return a copy of the original asset.

Sample URL with url encoded query string parameters:

http://192.168.1.6:8873/review/preview/assetPreview?bid=1&fuid=104&rrn=530&frn=2&aspectRatio=true&fqName=%2FShared-Project%2FCocaCola%2FBarbasol.jpg

Request parameters to get thumbnail:

“bid” : int

“fuid” : int

“rrn” : long

“frn” : int

fqPath:String

Using Ls command or other Zoom commands, or using the Find Web API, the above parameters can be fetched for an asset.

Response:

<Streamed thumbnail>

Request parameters to get preview:

“bid” : int

“fuid” : int

“rrn” : long

“resolution” : int // requested resolution minimum (height, width), aspect ratio automatically maintained

“aspectRatio”:”true”|”false”

“fqPath” : String

“filename”:String // base file name

Response:

<Streamed preview>

or

HTTP error code 404 if failed to create preview

or

HTTP error code 449 to retry if resources are unavailable.

Generate Default Preview

It is possible to trigger default preview generation for some assets on Preview server. For video assets only FLV file format is supported and for images only JPEG file format is supported.

The follow URL can be used to trigger the preview generation:

http://<YOUR-PREVIEW-SERVER>:8873/review/preview/assetPreview

To trigger the default preview generation for video files, following parameters has to be passed to above URL

  1. zm_server = http://<YOUR-ZOOM-SERVER>:8880
  2. zm_username = <USER NAME>
  3. zm_password = <USER PASSWORD>
  4. bid = 1
    1. Default is 1.
  5. fuid = 227 (Asset id of which preview generation needs to be triggered)
  6. rrn = 197 (Repository Revision Number aka RRN. Revision number on which asset has changed)
  7. aspectRatio = true
  8. resolution 480 (Default preview generation resolution.)
    1. This value must be same as the value specified in “Preview/Review Server Settings” in Zoom web management console.
  9. fqName = <Full path to Asset on Zoom server>
    1. /defproj/acme/video/cartoon.mp4
  10. fileType = FLV

For e.g: To trigger the preview generation for asset: “/defproj/acme/video/cartoon.mp4” with id 304 at RRN: 10, following url has to be created:

http://192.168.0.144:8873/review/preview/assetPreview?
zm_server=http://192.168.0.144:8880&
zm_username=admin&
zm_password=admin&
bid=1&
fuid=304&
rrn=10&
aspectRatio=true&
resolution=480&
fqName=/defproj/acme/video/cartoon.mp4&
fileType=FLV

Response on the above URL is the actual FLV file, streamed using HTTP protocol. Above request will block till the preview is generated. If you just want to trigger the preview generation, then set some lower value timeout, so that connection is break after triggering the call.

Leave a Comment