Class Socialveo\WebApi\Controllers\KarmaController

InheritanceSocialveo\WebApi\Controllers\KarmaController » Socialveo\WebApi\Controllers\RestApiController » Phalcon\Mvc\Controller
Uses TraitsSocialveo\Core\Translatable

Class KarmaController

Public Methods

Hide inherited methods

MethodDescriptionDefined By
_handleException() Handle exceptions Socialveo\WebApi\Controllers\RestApiController
_t() Gets translations Socialveo\Core\Translatable
afterExecuteRoute() After execute route, change return value to json Socialveo\WebApi\Controllers\RestApiController
beforeExecuteRoute() Before execute route, remove extra params Socialveo\WebApi\Controllers\RestApiController
checkClientCredentials() Checks client credentials Socialveo\WebApi\Controllers\RestApiController
decrypt() Decrypt value Socialveo\WebApi\Controllers\RestApiController
deleteAction() Removes a karma Socialveo\WebApi\Controllers\KarmaController
encrypt() Encrypt value Socialveo\WebApi\Controllers\RestApiController
getAction() Returns a karma Socialveo\WebApi\Controllers\KarmaController
getArrayFromParam() Returns array from params Socialveo\WebApi\Controllers\RestApiController
getLanguage() Gets language code Socialveo\WebApi\Controllers\RestApiController
getParams() Gets request params for Socialveo::filteredFind() Socialveo\WebApi\Controllers\RestApiController
getRequestData() Returns request data Socialveo\WebApi\Controllers\RestApiController
getRequiredParam() Get required param Socialveo\WebApi\Controllers\RestApiController
getToken() Get token Socialveo\WebApi\Controllers\RestApiController
getTranslation() Gets translations Socialveo\WebApi\Controllers\RestApiController
handleError() Handle errors Socialveo\WebApi\Controllers\RestApiController
handleException() Handle exceptions Socialveo\WebApi\Controllers\RestApiController
initialize() Initialize controller Socialveo\WebApi\Controllers\RestApiController
invalidMethodAction() Action trigger when invalid action tried run Socialveo\WebApi\Controllers\RestApiController
notFoundAction() Not found action Socialveo\WebApi\Controllers\RestApiController
posts() Gets posts Socialveo\WebApi\Controllers\RestApiController
replaceParam() Replace param Socialveo\WebApi\Controllers\RestApiController
respondWithItem() Response with item // * @deprecated Socialveo\WebApi\Controllers\RestApiController
sendJsonContent() Send response as json content and exit Socialveo\WebApi\Controllers\RestApiController
sendJsonContentRaw() Send json content Socialveo\WebApi\Controllers\RestApiController
sendJsonContentRawStatic() Send json content static Socialveo\WebApi\Controllers\RestApiController
setDefaultParam() Set default option Socialveo\WebApi\Controllers\RestApiController
t() Gets translations Socialveo\Core\Translatable
unsetParam() Unset get param Socialveo\WebApi\Controllers\RestApiController
updateAction() Updates a karma Socialveo\WebApi\Controllers\KarmaController

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
checkAccess() Checks during the init of controller whether user is a guest. Socialveo\WebApi\Controllers\RestApiController
log() Log full request data for debug Socialveo\WebApi\Controllers\RestApiController
objectsToArray() Convert objects to arrays Socialveo\WebApi\Controllers\RestApiController

Method Details

deleteAction() public method

Removes a karma

/karma/{karma_uuid}/delete

Method: POST

Access: Owner

Parameters:

{karma_uuid} required string karma uuid

Sample response:

{
    "status": "OK",
    "timestamp": 1234567890
}

public mixed deleteAction ( $karma_uuid )
$karma_uuid string

Karma uuid

throws Exception

Object not found

getAction() public method

Returns a karma

/karma/{karma_uuid}

Method: GET

Access: Owner

Parameters:

{karma_uuid} required string karma uuid

Returns: Karma

Sample response:

{
    "status": "OK",
    "data":{
        "type": "karma",
        "uuid": "e03b9030-6ecb-11e7-8d2a-54bef75c7a3f",
        "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",
        "event": "commentCreated",
        "target_uuid": "e030f210-6ecb-11e7-94d7-54bef75c7a3f",
        "target_type": "comment",
        "karma_type": "add",
        ...
    },
    "timestamp": 1234567890
}

public mixed getAction ( $karma_uuid )
$karma_uuid string

Karma uuid

updateAction() public method

Updates a karma

/karma/{karma_uuid}/update

Method: POST

Access: Owner

Parameters:

{karma_uuid} required string karma uuid
event required string type of event (eg. commentCreated, connectionConfirmed, networkCreated, etc.)
target_uuid required string the UUID of target item (eg. post)
target_type required string the type of target item (eg. post, comment, media, etc.)
karma_type required string type, either add or subtract
points required integer number of points to add or subtract

Affects: Karma

Returns: Karma

Sample response:

{
    "status": "OK",
    "data":{
        "type": "karma",
        "uuid": "e03b9030-6ecb-11e7-8d2a-54bef75c7a3f",
        "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",
        "event": "commentCreated",
        "target_uuid": "e030f210-6ecb-11e7-94d7-54bef75c7a3f",
        "target_type": "comment",
        "karma_type": "add",
        ...
    },
    "timestamp": 1234567890
}

public mixed updateAction ( $karma_uuid )
$karma_uuid string

Karma uuid

throws Exception