Add Badge
From KickApps Documentation
Contents |
Overview
This method is an admin method that will add a badge to the available set of badges in the kickapps community. This method will require a Webmaster / moderator token.
Request URL
http://api.kickapps.com/rest/badge/add/{as}
POST 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.
- location – customer’s designation of the area of their web site this badge belongs to [64 characters]
- name – The Name of the badge. [64 characters]
- verbosename - Verbose description of badge [256 characters]
- url – A URL to the badge's image file.
- link – link to area associated with this badge – no validation (added 10/29/10)
Optional
- callback. String. Optional. The name of your JavaScript callback function. (added 10/28/10)
- published – Boolean value that indicates whether or not the badge is published; can be awarded. (true, false - Defaults to false).
- Note: Badges can only be awarded if published == true. This allows the user to add requirements and avoid inadvertently awarding badges while the requirements are partially defined.
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…});
To further illustrate:
MyCallbackFunc({"status": 1, "added": True, "badgeId":"1234"});
Success: {"status": 1, "added": True, "badgeId":"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
- badgeId – The ID of the badge just added into the system.
- added – Boolean value indicating badge was successfully added.
errorId and errors
- 1 = invalid token
- 3 = name already in use
- 4 = name cannot be null or blank
- 5 = url invalid
- 6 = url cannot be null or blank
- 7 = invalid value for published (must be true or false)
- 16 = verbosename cannot be null or blank
- 18 = Insufficient user permissions for this operation
- 20 = location cannot exceed 64 characters
- 21 = name cannot exceed 64 characters
- 22 = verbosename cannot exceed 256 characters
- 44 = token required
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






