SDKs

Currently we offer a ruby SDK (which will work with or without rails) and a PHP SDK.

Ruby SDK | PHP SDK

Name Description Values Required Default
developer_mode If true request is free and resulting thumbnails are watermarked booleanNotrue
token Your Api Key stringYesN/A
source Your Video URL URLYesN/A
upload_url Where you wish the thumbnails to be uploaded URLYesN/A
number_of_thumbnails Number of thunbails required non-zero positive integerNo1
thumbnail_format Format of requested thumbnails jpg OR pngNojpg
width Desired thumbnail width non-zero positive integerNo120
height Desired thumbnail height non-zero positive integerNo90
thumbnail_styles Style of thumbnails to be created individual,gif,capsheetNoindividual
scale_mode Select method to scale the thumbnails pad OR stretch OR cropNopad
pad_color Background color for padded thumbnails Hex color valueNo000000
upload_placeholders If placeholders should be uploaded booleanNotrue
callback_url URL to be called on success/failure URLNoN/A
external_id If set, this will be sent with the callback. stringNoN/A
Animated Gif
gif_framerate Delay between frames of created GIF (in hundreths of seconds) non-zero positive integerNo30
Capsheet
capsheet_columns Number of columns on capsheet non-zero positive integerNo3
capsheet_video_info Display video info on capsheet booleanNotrue
capsheet_timestamp Display timestamp on capsheet thumbnails booleanNotrue
Signature
server_time Your server time as a Unix timestamp TimestampYesN/A
hash Signed hash of your parameters StringYesN/A

developer_mode

Required: No
Values: boolean
Default: N/A
developer_mode is a boolean flag that allows you to generate thumbnails without spending any credits. We recommend turning developer mode on when intergrating grabb.io with your site. Note: The thumbnails generated when in developer mode are given a grabb.io watermark.

token

Required: Yes
Values: string
Default: N/A
Your API key, you automatically receive one when you register and it can be found on the My Account section of this website. This must be included with all API keys. You will receive an error if the token is missing or invalid.

source

Required: Yes
Values: URL
Default: N/A
The location of the video you wish the generate thumbnails for. Both HTTP and RTMP links are supported. If a live RTMP stream is provided then the first 60 seconds will be captured and used for the thumbnails. If the video is inaccessible then you will receive an error with the HTTP response code.

upload_url

Required: Yes
Values: URL
Default: N/A
The destination for the thumbnails. FTP and S3 protocols are supported, you will receive an error in the account section if these are unreachable.

FTP

When using FTP, the format is: ftp://USERNAME:PASSWORD@HOST

S3

WHen using S3, The format is: s3://BUCKET_NAME Please make sure that the bucket you wish to write to has write access for the user [email protected]

number_of_thumbnails

Required: No
Values: non-zero positive integer
Default: 1
The number of thumbnails you wish to request. You will be charged at a rate of 1 credit per thumbnail requested regardless of how many types of thumbnails you request, regardless of how many different types you request.

thumbnail_format

Required: No
Values: jpg OR png
Default: jpg
Format of requested thumbnails. If you use the jpg format then transparency will not be supported.

width

Required: No
Values: non-zero positive integer
Default: 120
The width you require for your output thumbnails.

height

Required: No
Values: non-zero positive integer
Default: 90
The height you require for your output thumbnails.

thumbnail_styles

Required: No
Values: individual,gif,capsheet
Default: individual
Sets the style of the thumbnails multiple options can be set by separating them with commas. Examples with their corresponding thumbnail_styles values:

individual

individual example individual example individual example individual example individual example individual example
Each thumbnail is created as an individual image.

gif

gif example
The thumbnails are combined into an animated gif, the playback speed of which can be set using gif_framerate.

capsheet

capsheet example
The thumbnails are arranged on a single larger image called a "capsheet" (or capture sheet) the number of columns, the timestamps and the video info are configurable.

scale_mode

Required: No
Values: pad OR stretch OR crop
Default: pad
Sets the method used to scale the image. Examples with their corresponding scale_mode values:
scale_mode pad

pad

scale_mode stretch

stretch

scale_mode crop

crop

pad_color

Required: No
Values: Hex color value
Default: 000000
Sets the color of the "padding" on thumbnails generated with the scale_mode property set to "pad". Examples with their corresponding pad_color values:
pad_color default

default

pad_color #990000

#990000

pad_color transparent

transparent

Note: in order to generate thumbnails with transparent padding the thumbnail_format value must be set to png

upload_placeholders

Required: No
Values: boolean
Default: true
If set to true, before your video is processed, temporary placeholder images will be uploaded to the destination, allowing you to use the thumbnails from the initial API response.

callback_url

Required: No
Values: URL
Default: N/A
If set, upon failure or completion, grabb.io will call this URL with a json object stored as a POST parameter called message.

external_id

Required: No
Values: string
Default: N/A
If set, when the URL specified in the callback_url is called, the external_id will be included. This allows you to track grabbio videos using your id instead of ours. This means that you do not need to store the grabbio video_id for your request.

gif_framerate

Required: No
Values: non-zero positive integer
Default: 30
If gif is set as a thumbnail_stype then this value will be used as the delay bertween frames.

capsheet_columns

Required: No
Values: non-zero positive integer
Default: 3
The number of columns required for the capsheet. Rows will be automatically determined based on this value and the number_of_thumbnails value.

capsheet_video_info

Required: No
Values: boolean
Default: true
If true, the video information (Filesize, Filename, Width and Height) will be displayed at the top of the capsheet.

capsheet_timestamp

Required: No
Values: boolean
Default: true
If true, each thumbnail on the capsheet will contain a timestamp on the bottom left of the thumbnail.

server_time

Required: Yes
Values: Timestamp
Default: N/A
Your server time as a Unix timestamp. This is used to validate the time of requests from your server for security purposes.

hash

Required: Yes
Values: String
Default: N/A
Signed hash of your parameters, signed with your private key.

Format

This is a base64_encoded string of the binary data created by the HMAC digest using sha1. If you are using one of our SDKs then this will be done for you. The parameters is the query_string excluding the "?"

The parameters string should look something like "source=http://test.com&upload;_url=s3://test&token;=grabbio&server;_time=1302526504"
The hash generated from the above string with the secret key "grabbio" should be "cixjt11NmgBIibiuCOPeIXPyIog="

Ruby

Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), secret_key,parameters)).chomp.gsub(/\n/,'')

PHP

base64_encode(hash_hmac("SHA1", $parameters, $secret_key, 1));