Create Token
From KickApps Documentation
Contents |
Create Token
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.
A token is valid only for the site for which it was issued. The REST API requires a developer key, which is purchased from KIT Cloud Social. If your affiliate has multiple sites, you’ll need a separate developer key for each site to then create separate tokens. You should already have your developer key, but if not, please contact your KIT Cloud Social Business Development specialist for more information.
Your request will look something like the following:
http://api.kickapps.com/rest/token/create/{username}/{as}
OR
http://api.kickapps.com/rest/token/create/{email}/{as}
Parameters
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.
Post Parameters
- developerKey. Required. The developer key you were issued by KIT Cloud Social.
- password. Optional. The user's password.
- callback. Optional. The name of your JavaScript callback function.
- 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".
Example Requests
PHP
$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);
JSON Payload
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
[{"PRIVILEGES":"RW","TOKEN":Qqvb7kTFiz4M2lqCYzvjaA==,"METHOD":POST","payload_type":"json","role":"MEMBER","userId":4851902,"email":"nobody@kickapps.com","username":"nobody"}]
- 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:
| N | No privileges. Check that the correct information was passed and that you have access rights to the information you are requesting. |
| R | Read only. 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.
Favorites






