This method assigns the submitted rating value to the specified video.
The URL for this method accepts the following parameters:
|
appid
|
String value. Required.
The Application ID, which is a unique identifier, assigned by Truveo, for your application. To view your current Application ID or request a new one, please consult your My API Account page.
|
|
method
|
String value. Required.
The name of the method to invoke. In this case, the value of this argument should be set to 'truveo.videos.submitRating'.
|
|
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.
|
The XML response for this method can contain the following fields:
|
<Response>
|
The top-level field for the XML response.
|
|
<method>
|
Parent tag: <Response>
A string containing the name of the API method used to retrieve the response. In this case, this field would return the string 'truveo.videos.submitRating'.
|
|
<Result>
|
Parent tag: <Response>
The container for the response code, response message and any other information returned in this response.
|
|
<code>
|
Parent tag: <Result>
An integer specifying a code number for the response. This code number will typically be 1 for success and 0 for failure.
|
|
<message>
|
Parent tag: <Result>
A string containing a text message describing the response.
|
|
<videoId>
|
Parent tag: <Result>
An integer containing the unique id of the video for which the user rating was submitted.
|
|
<userRating>
|
Parent tag: <Result>
A decimal value between 0 and 5 representing the average user rating for the video identified by the videoId.
|
|
<userRatingCount>
|
Parent tag: <Result>
An integer representing the total number of times the video identified by the videoId has been rated.
|
A sample REST-style request for this method can be constructed as follows:
http://xml.truveo.com/apiv3
?appid=[myAppId]
&method=truveo.videos.submitRating
&id=1716860897
&rating=3
Example XML Response
A sample XML response for this method is listed in the text field below.
Errors
If execution of this method is not successful, the following error codes can be returned:
|
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.
|