media.rateFile

Syntax

float media.rateFile ( int id, int rating, int uid = 0, bool returnData = false )

Argument Info

NameTypeRequiredDefault valueDescription
idintRequirednoneId of the file you are rating.
ratingintRequirednoneThe rating of the file. HAS to be a number between 1 and 10 (inclusive).
uidintOptional0Userid of the person making the rating.
returnDataboolOptionalfalseFalse (default) to get the rating, true to get the data from getFileInfo.

Response returnData = 1

If returnData = 1 we return all the file information returned from a media.getFileInfo service call. View the full response from the media.getFileInfo service.

NameTypeDescription
ErrorThe rating of the media item.<error><message>Rating has to be an integer between 0 and 10 (inclusive)</message><type>Exception</type><code>0</code></error>

The rating of the file must always be included

If rating is not passed as a valid argument — a number between 0 and 10 an error will be returned.

NameDescriptionValue
SuccessThe rating of the media item.<result>10</result>
ErrorThe rating of the media item.<error><message>Rating has to be an integer between 0 and 10 (inclusive)</message><type>Exception</type><code>0</code></error>

Response returnData returnData = 0 of removed from request URL

If returnData = 0 or is not included in the URL we will only return the rating of the media item you just sent the request for.

NameTypeDescription
resultINTThe rating of the media item.

Return Values

FieldDescriptionPossible Values