twitvid

 

Twitvid API Method: uploadorresumeandpost

Page history last edited by Dmitry Bezborodov 5 mos ago

<< Back to Twitvid API Documentation

 

uploadOrResumeAndPost

Use this method to upload videos and send a tweet to Twitter (with resume support)

 

URL:

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

 

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: Optional. The message to be tweeted to the authenticated users Twitter account.
  • media_id: Optional. Value obtained from calling getId. This value will be used to identify which video to resume uploads for (if necessary).
  • 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.
  • See flowchart for details
  • 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
  • The message string can not be longer than 115 characters. Strings longer than this will return an error.
  • If playlist_id is used, the first video uploaded for a playlist will return a media_id that is the same as the playlistid.
  • If media_id is not specified, a regular upload attempt will be made. If specified, any uploaded data will be appended to the existing file on the server. The getLastByte method should be called prior to uploadOrResume to determine where the upload should resume from.
  • 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>44NH8</playlist_id>

               <media_id>PO9S9</media_id>

               <media_url>http://twitvid.com/PO9S9</media_url>

               <message>This is my tweet!</message>

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

               <vidResponse_parent>FSJS3</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":"44NH8",

          "media_id":"PO9S9",

          "media_url":"http://twitvid.com/PO9S9", 

          "message":"This is my tweet!",

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

          "vidResponse_parent":"FSJS3",

          "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.