Add User Action
From KickApps Documentation
Contents |
Overview
This is an admin method that is meant to track user actions to aid in the awarding users achievement based badges. This method will require a webmaster / moderator token. This may result in a user being awarded one or more badges.
Request URL
http://api.kickapps.com/rest/user/action/add/{as}
Request Parameters
Required
- t - the user token generated via the "Create Token" API call. Must be a webmaster / moderator token.
- as - The site Id to search. as is unique for each of the affiliate's sites.
- user_id – the user ID of the user being credited for performing the action.
- actionId – the ID of the action being performed.
- location – A location identifier that corresponds to a page / area within the community. For this iteration of the API it is assumed that Client will handle creation of these identifiers in their existing CMS system.
- Note: location+actionId comprise the compound key for this action.
Optional
- callback. String. Optional. The name of your JavaScript callback function.
- quantity – Integer of any sign (negative, positive, zero) containing the number of times this action should be counted towards earning this badge. If not specified, quantity should be considered to have a value of 1. (This facilitates giving bonuses to some activities and also facilitiates adjusting a user’s actions). If the value provided is negative, the user should never be adjusted below 0.
Response
Note: if callback is provided as an optional argument, the results illustrated below will be returned within the callback string provided for execution of a JavaScript function; e.g. callback=”MyCallbackFunc” will return something similar to:
MyCallbackFunc({…the success or failure response contained in curly braces you see below…});
Success: {"status": 1, "added": true, "userActionId":"1234"}
Failure: {"status": -1, "errorId": "123", "error": "Error Message"}
Response Parameters
- status – 1 on success and -1 on error.
- error – A message indicating the error condition
- errorId – A numeric reference to the error condition
- userActionId – The ID of the User Action just added into the system. (we’re not maintaining a record for each action – just a summary)
- added – Boolean value (true, false) indicating User Action was successfully added.
Error codes:
- 1 = invalid token
- 8 = location cannot be null or blank
- 10 = invalid actionId or actionId missing
- 11 = quantity must be an integer (Note: Only evaluated if this optional parameter is provided, else, a value of 1 is used.)
- 13 = invalid userId
- 18 = Insufficient user permissions for this operation
- 20 = location cannot exceed 64 characters
- 44 = token required
- 48 = User is either disabled or blocked
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






