HeyWatch Developers

CoreAPI: DownloadVideoFormatJobEncoded VideoAccount

Download Resource

The Download resource lets you transfer videos from your HTTP/FTP server to your HeyWatch account. This is the way to go to transfer any videos of any size.

You can add special parameters to automatically encode the video when the transfer is done and more. See below

Get all the downloads

GET /download.(xml|json)

With the cURL command:

curl -u username:passwd https://heywatch.com/download.json
[
  {
    "created_at": "2011-02-09T17:44:44+01:00",
    "error_msg": null,
    "title": "2134213DSFzfez324",
    "video_id": 7863245,
    "updated_at": "2011-02-09T17:44:36+01:00",
    "url": "http://site.com/videos/2134213DSFzfez324.bin",
    "progress": {
      "current_length": 0,
      "speed": 0,
      "percent": 100,
      "time_left": "Time"
    },
    "id": 3928279,
    "error_code": null,
    "length": 208,
    "status": "finished"
  }
]

Get information about a specific download

GET /download/ID.(xml|json)

With the cURL command:

curl -u username:passwd https://heywatch.com/download/3928279.json
{
  "created_at": "2011-02-09T17:44:44+01:00",
  "error_msg": null,
  "title": "2134213DSFzfez324",
  "video_id": 7863245,
  "updated_at": "2011-02-09T17:44:36+01:00",
  "url": "http://site.com/videos/2134213DSFzfez324.bin",
  "progress": {
    "current_length": 0,
    "speed": 0,
    "percent": 100,
    "time_left": "Time"
  },
  "id": 3928279,
  "error_code": null,
  "length": 208,
  "status": "finished"
}

Create a download

POST /download.(xml|json)

Parameters

Optional parameters

Optional job parameters

With the cURL command:

curl -u username:passwd -X POST \ 
-d "url=http://site.com/videos/2134213DSFzfez324.bin" \
-d "title=2134213DSFzfez324" \
-d "ping_url_after_transfer=http://mysite.com/heywatch/ping/transfer.php" \
-d "ping_url_if_error=http://mysite.com/heywatch/ping/error.php" \
https://heywatch.com/download.json
{
  "created_at": "2011-02-09T17:53:52+01:00",
  "error_msg": null,
  "title": "2134213DSFzfez324",
  "video_id": 0,
  "updated_at": "2011-02-09T17:53:52+01:00",
  "url": "http://site.com/videos/2134213DSFzfez324.bin",
  "progress": {
    "current_length": 0,
    "speed": 0,
    "percent": 0,
    "time_left": "??"
  },
  "id": 3928329,
  "error_code": null,
  "length": 0,
  "status": "pending"
}

If you set the ping urls in your account and decide to not override them in the request, the custom fields will be added at the end of the url to ping.

Encoding in multiple format

You can now encode the video to download in multiple format in only one request.

format_id, ftp_directive, s3_directive and http_upload_directive can take multiple values separated by ”,”. So let’s say you want to encode the video in flash flv (id=31) and mp4 (id=175) and send the 2 encoded videos to different ftp:

The flv video will go to ftp://u:p@host.com/videos/flv and the mp4 one to ftp://u:p@host.com/videos/mp4.

Note: Order is important!