Add or Remove Member As Friend
From KickApps Documentation
Contents |
Overview
Add or remove a friend from the member's friends list. Your request will look something like the following:
http://api.kickapps.com/rest/friend/{operation}/{friendId)/{as}
Parameters
As shown above, your call will include the following parameters:
- operation. add or remove.
- friendId. The id of the member to be added or removed.
- as. The site to be sent. 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".
Example Requests
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();
$friendId = $_REQUEST['friendId'];
$operation = $_REQUEST['operation'];
$rest_url = ADD_FRIEND_URL .$operation."/".$friendId."/".$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 return that begins with "status":"1","error":"".
List of KickApps 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






