twitvid

 

Twitvid API Method: upload

Page history last edited by Dmitry Bezborodov 5 mos ago

<< Back to Twitvid API Documentation

 

upload

Use this method to upload a video without sending a tweet to Twitter (no resume support)

 

URL:

http://im.twitvid.com/api/upload 

Formats: 

xml, json

 

HTTP Method:

POST

 

Requires Authentication:

true

 

Parameters

If passing in credentials, you must supply twitter username and password. You can not pass token if passing in credentials:

{

  • username: Required. Your Twitter username.
  • password: Requred. Your Twitter password.

}

else If passing in Authentication Token from authenticate, you can not pass the username and password:

{

  • token: Required. The Authentication Token

}

  • message: Required. The Twitter message. This message will not be tweeted and is used as supplementary meta-data to the video.
  • media_id: Optional. The media ID for this upload, obtained from GetID. Not setting this will generate a random media ID on back-end.
  • playlist_id: Optional. Value obtained from calling createPlaylist. This value will identify a parent container to house a collection of videos.
  • vidResponse_parent: Optional. This is the media_id for the video to which a response is to be added.
  • yt_username: Optional. Your YouTube username.
  • yt_password: Optional. Your YouTube password.
  • user_tags: Optional. Comma separated string of twitter users.
    • Example: @friend1, @friend2, @friend3
  • geo_latitude: Optional.
    • Example: 57.64911
  • geo_longitude: Optional.
    • Example: 10.40744
  • format: Optional. Select the return type (xml by default)
  • realtime: Optional. "1" to enable realtime mode (viewers can watch the video as it is being uploaded). You must contact us for integration instructions on using this feature. Simply passing "1" will not work.
  • duration: Optional. Specifies the duration, in seconds, of the uploaded video. This parameter must be supplied for videos uploaded in realtime.
  • thumbnail: Optional. Contains image data of the thumbnail to be associated with the video. This parameter can be supplied for videos uploaded in realtime. For non-realtime videos, the thumbnail is auto-generated.
  • media: Required. Binary video data must be posted as multipart/form-data

 

Usage Notes:

  • Either pass Twitter username and password, or pass token from authenticate. These are required for authentication.
  • The order of the passed in parameters is important. Always pass in the media data as the last parameter. Otherwise an error will be returned.
  • The returned media_id value can be used to generate an embed code
  • If playlist_id is used, the first video uploaded for a playlist will return a media_id that is the same as the playlistid.
  • playlist_id and vidResponse_parent can not be used simultaneously. If both values are set, only playlistid will be used.
  • Videos can be uploaded to your YouTube account automatically, by specifiying your YouTube credentials.
  • The location will only be recorded if both geo_latitude and geo_longitude are set.

 

Response

          XML example:

         <?xml version='1.0' encoding='UTF-8'?>

         <rsp status='ok'>

               <status_id>1111</status_id>

               <user_id>TwitUsername</user_id>

               <playlist_id>345yf</playlist_id>

               <media_id>3GS34</media_id>

               <media_url>http://twitvid.com/3GS34</media_url> 

               <user_tags>@friend1, @friend2, @friend3</user_tags>

               <vidResponse_parent>FJS2K</vidResponse_parent>

               <youtube_id>MRJ6k7bk61A</youtube_id>

               <youtube_url>http://www.youtube.com/watch?v=MRJ6k7bk61A</youtube_url>

               <geo_latitude>57.64911</geo_latitude>

               <geo_longitude>10.40744</geo_longitude>

          </rsp>

 

          JSON example:

          {"rsp":"ok",

          "status_id":"1111",

          "user_id":"TwitUsername",

          "playlist_id":"345yf",

          "media_id":"3GS34",

          "media_url":"http://twitvid.com/3GS34",

          "user_tags":"@friend1, @friend2, @friend3",

          "vidResponse_parent":"FJS2K",

          "youtube_id":"MRJ6k7bk61A",

          "youtube_url":"http://www.youtube.com/watch?v=MRJ6k7bk61A",

          "geo_latitude":"57.64911,

          "geo_longitude":"10.40744"}

 

<< Back to Twitvid API Documentation 

Comments (0)

You don't have permission to comment on this page.