API documentation

Video ยป POST

Upload a video to the video sites.

Arguments

  • title (Required)

    Title of the video

  • description (Required)

    Description of the video

  • tags (Required)

    Tags of the video. Minimum is 2 tags

  • category (Required)

    Category of the video. Can be 'Auto & vehicles', 'Comedy', 'Entertainment', 'Film & Animation', 'Gadgets & Games', 'Howto & DIY', 'Music', 'News & Politics', 'People & Blogs', 'Pets & Animals', 'Sports', 'Travel & Places'

  • file (Required if no url)

    The video object file (multipart form required)

  • url (Required if no file)

    The URL of a video. Can be a direct link, YouTube or Google link.
    Eg. http://myhost.com/videos/1234.avi
    Eg. http://youtube.com/watch?v=1dsfsd4_ds

  • site name (Required if no saved credentials)

    The value must be login:password.
    If you saved your credentials, you don't need to submit the credentials here unless you want to use another account. You can add many site credentials at once.
    Eg. youtube=ytlogin:ytpassword
    Eg. youtube=ytlogin:ytpassword&google=google@gmail.com:googlepassword&revver=...&...

  • ping

    When the job is done, you will receive all the links and errors to this ping address. See Ping page for more information.
    Eg. http://myhost.com/ping/heyspread.php

  • watermark_image_url

    URL of a logo (.png) to overlay on the video

  • watermark_position

    This is the logo position. Can be "topleft" or "bottomright". Default is "topleft"

  • convert Recommended

    if "true", the video will be encoded in a standard format before being uploaded. This is to avoid format incompatibility with video sites.

  • stat

    if "true", the video will have statistics enabled.

  • email

    You will receive all the video links at this address.

Request example

cURL

curl \
-F "file=@/home/user/myvideo.avi" \
-F "title=testing" \
-F "category=Entertainment" \ 
-F "tags=heyspread testing" \ 
-F "description=Just for testing the Hey!Spread API" \ 
-F "youtube=demoheyspread:mypasswd" \ 
-F "google=demoheyspread@gmail.com:mypasswd" \ 
-F "api_key=75b5744011e2dddbf2261e157505958b" \ 
--url "http://heyspread.com/api2/video"

Ruby

video = HeySpread::Video.new(
  :title => "testing",
  :category => "Entertainment",
  :tags => "heyspread testing",
  :description => "Just for testing the Hey!Spread API",
  :file => "/home/user/myvideo.avi"
)

video.destinations["youtube"] = ["demoheyspread", "mypasswd"]
video.destinations["google"]  = ["demoheyspread@gmail.com", "mypasswd"]

video.upload

PHP

$video = new HeySpread_Video(array(
  "title" => "testing",
  "category" => "Entertainment",
  "tags" => "heyspread testing",
  "description" => "Just for testing the Hey!Spread API",
  "file" => "/home/user/myvideo.avi"
));

$video->destinations["youtube"] = array("demoheyspread", "mypasswd");
$video->destinations["google"] = array("demoheyspread@gmail.com", "mypasswd");

$video->upload();

Response example

200 OK

<video>
  <id>556</id>
  <title>testing</title>
  <description>Just for testing the Hey!Spread API</description>
  <category>Entertainment</category>
  <tags>heyspread testing</tags>
  <created-at>Wed May 07 18:34:09 +0200 2008</created-at>
  <updated-at>Fri May 09 19:07:29 +0200 2008</updated-at>
  <status>uploading</status>
  <stat>false</stat>
  <uploads>
    <upload site="google" time-left="00:01:14" percent="50" transferred="3400" total="6800" speed="121" />
    <upload site="youtube" time-left="00:00:28" percent="75" transferred="5100" total="6800" speed="408" />
  </uploads>
  <links>
  </links>
  <errors>
  </errors>
</video>

See GET /video for more information.

400 Bad Request

<errors>
  <error>Title can't be blank</error>
</errors>