API Reference

Media.logHit

Use this method to log a hit (aka view) on a media item.


Syntax

mixed media.logHit ( int fileId, int fileType, int fileSize, int uid = 0 )

Arguments

NameTypeRequiredDefault valueDescription
fileIdintRequirednoneThe ID of the media item you want to log a hit against.
fileTypeintRequirednoneThe media file type you are going to log a hit against.
fileSizeintRequirednoneThe filesize of the media you are going to log a hit against. This value is in KBs.
uidintOptional0The id of the user who viewed the item, for gamification purposes.

Fields

A description of fields that are required and need to be passed with the service call.

NameTypeDescriptionPossible Values
fileIdINTThe ID of the media item you want to log a hit against.INT
fileTypeINTThe file type INT of the media item that you are going to log a hit against.0,1,2,3,4
fileSizeINTThe file size of the media item that you are going to log a hit against. The fileSize must be represented in KB.INT

Response

An explination of the successful response of a hit being logged in a piece of media.

NameTypeDescriptionSuccessERROR
resultemptyAn empty reponse is returned if there is a successful hit logged on the media IDempty<error><message>Field mid has to be of type integer</message><type>Exception</type><code>0</code></error>

Sample Response

Sample REST Response
http://api.newspark.ca/services/rest/media/logHit?fileId=[MEDIA_ID]&fileType=[FILETYPE]&fileSize=[FILE_SIZE]
<?xml version="1.0" encoding="UTF-8"?>
<result>1</result>
Sample JSON Response
{
    "status": true,
    "result": 1
}

Code examples

0 comments

Be the first to comment on logHit.

Add a Comment

  • captcha