Add or Remove Media Flag
From KickApps Documentation
Contents |
Overview
Flags mark a given piece of media as being inappropriate. When a flag is added, the media owner and the affiliate are notified. “This page is flagged for review” message displays to the member who issued the flag. You can also flag a user profile or a media comment using the Flag Comment call.
This call is used to add a flag to a given id. You can make an HTTP POST or GET request when using this call. When a flag is added, the owner of the media receives a notification email.
Members and anonymous users may flag media. For members, flags are associated with the userId via the token. For anonymous users (with anonymous tokens), flags are associated with the user’s current IP address. An anonymous user can only flag once from one IP address.
Your request will look something like the following:
http://api.kickapps.com/rest/flag/{operation}/{mediaType}/{mediaId}/{as}
Parameters
As shown above, your call will include the following parameters:
- operation. add or remove.
- mediaType. The media type. audio, photo, sets, blog, user or video. KickApps' sample applications use mediaType to check for the Flash player to use.
- mediaId. Integer. The id for the file being flagged. This is specific to both the affiliate site and the media type.
- as. The site that this media id is associated with. as is unique for each of the affiliate's sites.
Post Parameters
- t. String. Required. Your access permissions.
- callback. String. Optional. The name of your JavaScript callback function.
- clientIP. String. Optional. Use the clientIP parameter to pass the IP address of the user making the call. If the IP has been blocked by the webmaster under the Affiliate Center -> Manage Members section, an error message will be returned starting with "status":"-1","error":"This IP address has been banned".
- message. Optional. A description of why the media is inappropriate. Can be between 1 and 5,000 characters in length.
- ip. Required for anonymous users. The user’s current IP address (this data is used to ensure that each user can only flag each media item once).
Example Requests
The following requests show an application's call to the REST API, see the relevant sample application code for more details.
PHP
$ka_token=$_SESSION['token'];
if ($ka_token == "" || $ka_token->getToken() == "") {
//Since token is null member is not logged in send them back
redirect(dirname($_SERVER['PHP_SELF'])."/login.php");
}
$as = $ka_token->getAs();
$mediaType = $_REQUEST['mediaType'];
$mediaId = $_REQUEST['mediaId'];
$operation = $_REQUEST['operation'];
$rest_url = FLAG_PAGE_URL . $operation."/".$mediaType ."/". $mediaId."/".$as;
$ch = curl_init($rest_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 't='.$ka_token->getToken());
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$buf=curl_exec ($ch);
curl_close ($ch);
JSON Payload
On success, a payload that begins with "status":"1","error":"".
List of Kit Cloud Social API Calls
Note: Occasionally (and without advanced warning) we modify our API calls by adding new parameters in the response payload. Please keep this in mind when designing your strategy for parsing our responses.
Favorites






