Developer Center
submitRating Method
 
Description
This method assigns the submitted rating value to the specified video.
 
Arguments
This method accepts the following arguments:
id
Integer. Required.
The unique id value for an available video in the search engine.
rating
Number between 0 and 5. Required.
The numerical rating that will be assigned to the video. This is a number between 0 and 5 that, when submitted, will be averaged with the other user ratings assigned to this video to determine an aggregate rating.
 
Syntax
The following code sample illustrates how this method can be invoked:
TVS = new TruveoVideoSearch(appid);
...
TVS.submitRating(id, rating);
 
Return Value
This method returns 'true' if the AJAX request was sent successfully. This method will return 'false' if it is called with the incorrect number of arguments.
 
Response Data Objects
The response returned by this method can update the following data objects:
method A string containing the name of the API method used to retrieve the response. In this case, this field would return the string 'submitRating'.
Usage syntax: myVar = TVS.method;
Result The container for the response code, response message and any other information returned in this response. More details on the structure and attributes of this data object can be found here.
Usage syntax: myVar = TVS.Result;
 
Events
This method can fire the following events:
onupdate This event fires when a response to an AJAX request is received by the TruveoVideoSearch object. When this event fires, it will pass one argument, 'methodName', to any handler attached to this event. The value of 'methodName' will be set to the name of the method that issued the original AJAX request associated with this onupdate event.
Event binding syntax: TVS.attachEvent('onupdate', 'myHandler(methodName);');
onerror This event fires when an error occurs. When this event fires, it will pass two arguments, 'errorCode' and 'errorMessage', to any handler attached to this event. The value of 'errorCode' will be the numerical code assigned to the error and 'errorMessage' will be a text message that describes the error.
Event binding syntax: TVS.attachEvent('onerror', 'myHandler(errorCode, errorMessage);');
 
Errors
If execution of this method is not successful, the errors with the following error codes can be thrown:
1
Invalid request: 'appid'
An application ID was not submitted with the request.
2
Invalid request: 'method'
A method was not submitted with the request.
6
Invalid request: 'id'
The id parameter was not submitted with the request.
20
Invalid request: 'id'
The video id that was supplied in the request does not exist.
18
Invalid request: 'rating'
The rating parameter was not submitted with the request.
19
Invalid request: 'rating'
The rating parameter must be between 0 and 5.
12
Service Unavailable
Truveo Video Search API service unavailable.
13
Method not found.
The method you submitted with the request was not valid.
14
Access Denied: invalid appid.
The application ID submitted with the request is invalid.
15
Access Denied: appid over limit.
The application ID submitted with the request is over the daily request limit.
501
Error connecting to XMLHTTP AJAX service
The Truveo video search AJAX service could not be reached.
502
Invalid AJAX method call: The wrong number of arguments was provided to this method.
A method of the AJAX API was called with too many or too few arguments.
Help Company Info Developer Resources Video Publisher Resources
Building Queries About Truveo Developer Center Truveo Director Accounts
Basic Searching Press Truveo API Overview Submitting A Feed Using Media RSS
Using Modifiers Team XML API Director Account FAQ
Using Filters Jobs AJAX API  
Using Sorters Contact Us Flash API  
Advanced Searching Terms of Use Ruby API  
  Privacy Policy Application Gallery  
  Adult FAQ    

Truveo video search lets you search and find videos from across the Web. Use Truveo to find all types of online video including hit television shows, full-length movies, breaking news clips, sports highlights, music videos, or the latest viral videos. If you are looking for a specific video, Truveo video search can help you find exactly the video you want. Truveo can also help you browse through video across the web and discover new videos that you might like.

©2004-2009 Truveo, Inc. All Rights Reserved.