Add To Or Remove From Favorites
From KickApps Documentation
Contents |
Overview
Adds or removes a given media id to a member's favorites. You can make an HTTP POST or GET request when using this call.
Your request will look something like the following:
http://api.kickapps.com/rest/favorite/{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, blog, video, sets, or emedia.
- mediaId. The id of the media that is being added or removed from the member's favorites. id is specific to both as and the type. For external media, this value can be anything, but it must be included (it is nonfunctional).
- as. The site to which the comment will be added. 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".
- url. Required for external media only (do not include in other calls). The URL of the external media (same as pathToMedia).
Example Requests
The following requests show an application's call to the REST API, see the relevant sample application code for more details.
PHP
$token = $_SESSION['token']; //$operation can be "Add" or "Remove" $favorite_url = FAVORITE_PAGE_URL.$operation.'/'.$type.'/'.$id.'/'.$as; $ch = curl_init($favorite_url); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "t=$token->token"); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $buf=curl_exec ($ch); $token->payload=$buf;
JSON Payload
On success when a favorite is either added or removed, a payload that begins with "status":"1","error":"".
Sample Payload for adding media to favorite:
{"info":"media added as favorite","payload_type":"json","status":"1","error":""}
Sample Payload for removing media from favorite:
{"info":"media is removed from favorite","payload_type":"json","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






