method-videos-prepareUpload
Last edited: August 19th, 2009 by Colin DevroeThere are two possible solutions for video upload via API call. First one is regular viddler.videos.upload API call. When upload call to this method is received it scans the request and proxies it to best possible upload server. Everything is done in the background and doesn’t require any additional client side interaction. Disadvantage of this solution is that the upload will go through multiple servers before reaching its final location. This may cause some slowness in certain situations (API nodes overload etc).
To prevent this you may use second (preferred) solution. Call viddler.videos.prepareUpload method which will assign the best possible upload node for you. After reading the response use “endpoint” tag value as new API endpoint for viddler.videos.upload method call instead of standard http://api.viddler.com/rest/v1/ endpoint.
This method is available since API version 1.3.0.
Note: ALL arguments are required.
Authenication
This method requires authentication with viddler.users.auth API method.
Arguments
- method
- Should be set to “Viddler.videos.prepareUpload”
- api_key
- Assigned Viddler API Key
- sessionid
- The session ID assigned during user authentication.
Example Call
http://api.viddler.com/rest/v1/?method=viddler.videos.prepareUpload&api_key=12345&sessionid=9e107d9d372bb6826bd81d3542a419d6
Example Response
<?xml version="1.0" encoding="UTF-8"?> <upload> <endpoint>http://SERVER.viddler.com/viddler_upload/upload/uploadvideo</endpoint> </upload>