API Reference

Media.reportOffensive

This function marks a particular media as offensive.

Note: A user can report a media as offensive once, unless the user id is 1; user id 1 can mark the same media as offensive multiple times.

You can pass various optional parameters to this function, including the id of the user who reported the media as offensive and the reason why the media was reported offensive. If you wish to send an email to a particular person upon the use of this function, then you have to set the following parameters: "templateid" and "to". The "templateid" defines the template to be used for the email, and "to" defines the recipient's email

The variables available in the email are: "media_id", "vhost", "uid", "date" and "reason". Please refer to the table below for more information.


Syntax

mixed media.reportOffensive ( int vhost, int mid, array parameters = array() )

Arguments

NameTypeRequiredDefault valueDescription
vhostintRequirednoneThe vhost ID of the media item you want to log as offensive.
midintRequirednone The media ID of the media item that you are going to log as offensive.
parametersarrayOptionalarray()These are various fields that are completely optional.
Sample values are:
parameters[uid]=1927700
parameters[reason]=inappropriate
parameters[templateid]=34529
parameters[to]=your.name@gmail.com

For more information please refer to the "Parameters" table below.

Parameters

The optional parameters that can be passed as an array.

NameTypeDescription
uidINTThis is the id of the user who is reporting the media item as being offensive
reasonSTRINGThis is the reason why the user is flagging this media as offensive.
Note: This value has a maximum length of 255 characters.
templateidINTSet templateid to send an email to a specified user. The recipient's email address is set in the "to" parameter.
Note: When "templateid" is set, you need to define tempate variables for the email, as displayed in the "Email Template Parameters" table below.
toSTRINGThe e-mail address that the report is going to.

Email Template Parameters

The variables that are available within the email template, for the email that is sent when the parameter templateid is set.

NameTypeDescription
media_idINTThe id of the media reported as offensive
vhostINTThe id of the project that contains the media reported as offensive
dateDATETIMEThe date and time that the media was reported as offensive
uidINTThe id of the user who reported the media item as offensive
reasonSTRINGThe reason why the media was reported as offensive (if provided by the user)

Sample Response

Sample REST Response
http://api.newspark.ca/services/rest/media.reportOffensive?vhost=[VHOST_ID]&mid=[MID]&parameters[uid]=[UID]&parameters[reason]=[REASON]&parameters[templateid]=[TEMPLATE_ID]&parameters[to]=[TO]
<result>1</result>
Sample JSON Response
{
    "result":"1"
}

Code examples

0 comments

Be the first to comment on reportOffensive.

Add a Comment

  • captcha