From KickApps Documentation
Your first API request to the KIT Cloud Social server will be a call for a token. You must use a POST request when using this call. A token is used to retrieve information for a specific member of a specific affiliate site.
Your request will look something like the following:
As shown above, your call will include the following parameters:
- username. A registered member for this site. On the KIT Cloud Social platform, username is associated with a specific affiliate site.
- email. Email address of registered member for this site. If you are using username as the parameter for this call, you are not permitted to use email as the additional parameter.
- as. The affiliate site id for the specific site you need to access. Note that an affiliate can have multiple sites.
- developerKey. Required. The developer key you were issued by KIT Cloud Social.
- password. Optional. The user's password.
- clientIP. 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".
$as = AFFILIATE_SITE_ID; $devKey=DEVELOPER_KEY; $rest_url = CREATE_TOKEN_URL.$_REQUEST['username'].'/'.$as; print $rest_url."<br/>"; $ch = curl_init($rest_url); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, 'developerKey='.$devKey); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $buf=curl_exec ($ch);
On success a response such as the following which enables GET and POST calls to this site. If "PRIVILEGES":"R" is returned, the token can be used only for GET calls.
Example JSON Response
- token. An alphanumeric string. This must be included in your subsequent API calls.
- method. The HTTP request you can make to the server. The resulting payload will be GET if you have read-only permissions and POST if you have read-write permissions.
- privileges. Your access rights to information for this affiliate site, which will be one of the following:
Check that the correct information was passed and that you have access rights to the information you are requesting.
You can make GET requests but not POST requests to the server. If you use anonymous as the value for username, read-only permissions will be returned. Important: Note that some calls do require read-write access.
|RW||Read and write.|
You can make both POST and GET calls to the server. You will need to supply a valid username for the affiliate site to receive read-write permission
- as. The numeric affiliate site id for the site that the username is associated with. The value for affiliate site id is different for each of the affiliate's sites.
- userId. The numeric ID for this member. Pass this as a parameter in subsequent calls. Your token is only good for this userId.
- username. The member's username - useful for subsequent API calls (especially RSS API calls).
- email. The email address for this member.
- role. The status of the member. The status will be in this form: Member, Webmaster, or Editor.
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.