Edit Badge

From KickApps Documentation

Jump to: navigation, search

Contents

Overview

This method is an admin method that will edit a badge from the available set of badges in the BET community. This method will require a Webmaster / moderator token.

Request

http://api.kickapps.com/rest/badge/edit/{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.
  • badgeId – The ID of the badge just added into the system.


Optional

  • callback. String. Optional. The name of your JavaScript callback function.
  • 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.
    • Note: When published is set to true, the system will determine which users should be awarded this badge.
  • 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

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: Success: {"status": 1, "edited": 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:

*Note: This error may only occur if the corresponding optional request parameter is provided. Null values provided for optional parameters result in ignoring the parameter; treating it as if it was not provided. While the error message may read “cannot be null”, there will never be a condition where a null value for an optional parameter can result in an error.

  • 1 = invalid token
  • 3 = name already in use (by another badge) (*)
  • 4 = name cannot be blank (*)
  • 5 = url invalid (*)
  • 6 = url cannot be null or blank (*)
  • 7 = invalid value for published (must be true or false) (*)
  • 8 = location cannot be blank (*)
  • 9 = Invalid badgeId or badgeId missing
  • 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 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.