Add Action

From KickApps Documentation

Jump to: navigation, search

Contents

Overview

This method is an admin method that adds an action to the system. An action is defined by an id in the system and a name. Actions will be tracked by the system so that users can be awarded achievement badges. Actions will not have a location, though user actions (from Add User Action) will find the action in the action table and accumulate the action for the user attributed to location+action ;this will allow us to accumulate history for actions by any location even when a badge doesn’t exist for that location.

Request URL

http://api.kickapps.com/rest/badgeaction/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.
  • name – The name of the action (limited to 32 characters – 1 character minimum)


Optional

  • callback. String. Optional. The name of your JavaScript callback function.

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, "actionId":"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
  • actionId – The ID of the action just added into the system.
  • added – Boolean value indicating action was successfully added.


ErrorId and Errmsg:

  • 1 = invalid token
  • 3 = name already in use
  • 4 = name cannot be null or blank
  • 18 = Insufficient user permissions for this operation
  • 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.