Videogram Upload And List Api

VIDEOGRAM CREATE API

OVERVIEW

This API accepts standard form POST, gets the remotely-hosted movie server-to-server, processes it into a videogram and sends an email when ready. Processing time varies depending on video length and server load, but is usually less than 5 minutes for shorter titles.

Prerequisites:

Create a free publisher account at http://cinemacraft.tv/solutions#register-form and then mail api@videogram.com for the API_KEY

DESCRIPTION

Request Type: POST (all parameters required)
Accepts: application/x-www-form-urlencoded
Returns: application/json
Parameters:

  • api_key: 1234abcd-e56f-4789-0123-456789abcdef
  • url: http://example.com/video/ (Accepts top-page / share urls from most services like Vimeo, Dailymotion, Youtube etc. or a direct url of any streamable .mp4 file).
  • title: Title of the Video.
  • email: me@example.com (A message will be sent to this address when the video has been processed, the id and url of the finished videogram will be in the email)

RESPONSE

200 : Ok + detailed info in JSON format
400 : Bad Request
403 : Forbidden ( i.e. bad / missing api key )
500 : Internal Server Error.

400 series responses include details in JSON format.
500 series responses contain no useful information in the response body.

EXAMPLE:

RESULT


VIDEOGRAM LIST API

OVERVIEW

This api returns all the videograms created by this user/api_key.

DESCRIPTION

Request Type : GET (all parameters required)
Accepts: text/plain
Returns: application/json
Parameters:

  • api_key: 1234abcd-e56f-4789-0123-456789abcdef
  • offset: 0 (Start at this value if you want to do list paging)
  • limit: 10 ( you get this many items back )

RESPONSE

200 : Ok + detailed info in JSON format. See below for example
400 : Bad Request
403 : Forbidden ( i.e. bad / missing api key )
500 : Internal Server Error

400 series responses include details in JSON format.
500 series responses contain no useful information in the response body.

EXAMPLE:

RESULT

VIDEOGRAM GRID API

OVERVIEW

Returns the 2-dimensional grid for a given width and height

DESCRIPTION

Request Type : GET (all parameters required)
Accepts: application/x-www-form-urlencoded
Returns : application/json
Parameters:

  • uuid: 1234abcd-e56f-4789-0123-456789abcdef
  • width: Width of the grid
  • height: Height of the grid
  • frame_count: Frame count and Width+Height are mutually exclusive parameters. If frame_count is ZERO only then widh and height is used. If frame count is NON-ZERO then it will return the grid with these many frames.

RESPONSE

200 : Ok + detailed info in JSON format. see below for example
400 : Bad Request
403 : Forbidden ( i.e. bad / missing uuid )
500 : Internal Server Error

400 series responses include details in JSON format.
500 series responses contain no useful information in the response body.

EXAMPLE:

VIDEOGRAM GRID OUTPUT

NOTES

time: Time returned is in milli seconds
remote_album_id: Id of the video if the video is of a network which is integrated by Videogram. Else Url of the video
album_network: Video network

VIDEOGRAM EMBED CODE

Embed urls can be made simply by replacing the uuid below with the value returned in create videogram api and also support autoplay. Standard embed iframe code looks like this

You must declare width and height, but you don’t have to do it inline. Heights such as 80vh work quite well, and the width in the above example allows the embed to flex with the page.

Recommended Grid Processing

This example is written in Javascript. The functions processError and formatTime are not included.

‘ ; return html .replace(‘%top%’ , obj.top ) .replace(‘%left%’ , obj.left ) .replace(‘%width%’ , obj.width ) .replace(‘%height%’ , obj.height ) .replace(‘%kfurl%’ , obj.url ) .replace(/%seg_id%/g , obj.seg_id ) .replace(‘%seg_id_hr%’ , formatTime( obj.seg_id / 1000 ) ) }

Recommended Base CSS