TotSpot

Video

Formats

Both "json" and "xml" formats are available and can be chosen by sending the "format" parameter in the request.

Available Methods

The "create" method

The "create" method will receive a valid url from a video hosted on Vimeo or YouTube and automatically retrieve the details (such as title, description and the date the video was actually shot at) from the original video. These details can also be overwritten by sending them as request parameters. The method will always return the Video object that was just created on TotSpot.

Request

To create a video, you should make a HTTP request to "http://totspot.com/api/videos/create". The following parameters are accepted and mandatory:
  • "url" - This is a valid YouTube or Vimeo URL (such as "http://vimeo.com/1292361" or "http://www.youtube.com/watch?v=oHg5SJYRHA0")
These details are automatically retrieved from the original video but you can overwrite them by sending these parameters on your request:
  • "title"
  • "description"
  • "shot_at"

Response

Hopefully, if you've done everything right on your end and we did on our, you should get a response like this:

<?xml version="1.0" encoding="UTF-8"?>
<video>
  <created-at type="datetime">2008-08-22T16:33:20+01:00</created-at>
  <description>As melhores piadas são as do empregado d'A Brasileira!</description>
  <html-tag><object type="application/x-shockwave-flash" width="400" height="277" data="http://www.vimeo.com/moogaloop.swf?clip_id=1292361&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA"><param name="quality" value="best" /><param name="allowfullscreen" value="true" /><param name="scale" value="showAll" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=1292361&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA" /></object></html-tag>
  <id type="integer">36</id>
  <remote-id>1292361</remote-id>
  <shot-at type="datetime">2008-07-06T16:56:05+01:00</shot-at>
  <thumbnail>http://images.vimeo.com/92/90/22/92902250/92902250_200x150.jpg</thumbnail>
  <title>10. Vender Fiado</title>
  <updated-at type="datetime">2008-08-22T16:33:20+01:00</updated-at>
  <url>http://vimeo.com/1292361</url>
  <provider>Vimeo</provider>
</video>

The "get_all" method

This method will get all of the Videos from a given user.

Request

You just need to make a HTTP request to "http://totspothome.com/api/video/get_all". This method requests no parameters but the "format" one.

Response

Again, if everything goes as it should, this is the response you can expect:

<?xml version="1.0" encoding="UTF-8"?>
<videos type="array">
  <video>
    <created-at type="datetime">2008-08-01T17:30:20+01:00</created-at>
    <description></description>
    <html-tag><object type="application/x-shockwave-flash" width="400" height="277" data="http://www.vimeo.com/moogaloop.swf?clip_id=1407409&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA"><param name="quality" value="best" /><param name="allowfullscreen" value="true" /><param name="scale" value="showAll" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=1407409&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA" /></object></html-tag>
    <id type="integer">35</id>
    <remote-id>1407409</remote-id>
    <shot-at type="datetime">2008-07-25T14:09:10+01:00</shot-at>
    <thumbnail>http://images.vimeo.com/10/46/79/104679018/104679018_200x150.jpg</thumbnail>
    <title>COMUNICADO</title>
    <updated-at type="datetime">2008-08-01T17:30:20+01:00</updated-at>
    <url>http://vimeo.com/1407409</url>
    <provider>Vimeo</provider>
  </video>
  <video>
    <created-at type="datetime">2008-08-22T16:33:20+01:00</created-at>
    <description>As melhores piadas são as do empregado d'A Brasileira!</description>
    <html-tag><object type="application/x-shockwave-flash" width="400" height="277" data="http://www.vimeo.com/moogaloop.swf?clip_id=1292361&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA"><param name="quality" value="best" /><param name="allowfullscreen" value="true" /><param name="scale" value="showAll" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=1292361&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA" /></object></html-tag>
    <id type="integer">36</id>
    <remote-id>1292361</remote-id>
    <shot-at type="datetime">2008-07-06T16:56:05+01:00</shot-at>
    <thumbnail>http://images.vimeo.com/92/90/22/92902250/92902250_200x150.jpg</thumbnail>
    <title>10. Vender Fiado</title>
    <updated-at type="datetime">2008-08-22T16:33:20+01:00</updated-at>
    <url>http://vimeo.com/1292361</url>
    <provider>Vimeo</provider>
  </video>
</videos>
If you happen to send in the "format" parameter as "json", you should get this output:

[{"video": {"updated_at": "2008-08-01T17:30:20+01:00", "thumbnail": "http://images.vimeo.com/10/46/79/104679018/104679018_200x150.jpg", "title": "COMUNICADO", "url": "http://vimeo.com/1407409", "provider": "Vimeo", "id": 35, "shot_at": "2008-07-25T14:09:10+01:00", "description": "", "remote_id": "1407409", "html_tag": "<object type=\"application/x-shockwave-flash\" width=\"400\" height=\"277\" data=\"http://www.vimeo.com/moogaloop.swf?clip_id=1407409&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=0&color=01AAEA\"><param name=\"quality\" value=\"best\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"scale\" value=\"showAll\" /><param name=\"movie\" value=\"http://www.vimeo.com/moogaloop.swf?clip_id=1407409&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=0&color=01AAEA\" /></object>", "created_at": "2008-08-01T17:30:20+01:00"}}, {"video": {"updated_at": "2008-08-22T16:33:20+01:00", "thumbnail": "http://images.vimeo.com/92/90/22/92902250/92902250_200x150.jpg", "title": "10. Vender Fiado", "url": "http://vimeo.com/1292361", "provider": "Vimeo", "id": 36, "shot_at": "2008-07-06T16:56:05+01:00", "description": "As melhores piadas s\u00e3o as do empregado d'A Brasileira!", "remote_id": "1292361", "html_tag": "<object type=\"application/x-shockwave-flash\" width=\"400\" height=\"277\" data=\"http://www.vimeo.com/moogaloop.swf?clip_id=1292361&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=0&color=01AAEA\"><param name=\"quality\" value=\"best\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"scale\" value=\"showAll\" /><param name=\"movie\" value=\"http://www.vimeo.com/moogaloop.swf?clip_id=1292361&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=0&color=01AAEA\" /></object>", "created_at": "2008-08-22T16:33:20+01:00"}}]

Please Login or Signup to the developer section to manage your applications.

API Documentation

© TotSpot - All rights reserved. | Contact us