Class Socialveo\WebApi\Controllers\EmotionsController

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

Class ReactionsController

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() Delete emotions associated with the given target_type Socialveo\WebApi\Controllers\EmotionsController
encrypt() Encrypt value Socialveo\WebApi\Controllers\RestApiController
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
listAction() Return a lists of emotions associated with the given target_type Socialveo\WebApi\Controllers\EmotionsController
manageAction() Create/update/delete emotions associated with the given target_type Socialveo\WebApi\Controllers\EmotionsController
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

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

Delete emotions associated with the given target_type

/emotions/{target_type}/{target_uuid}/delete

Method: POST

Access: OwnerTarget || UserHasAccessTarget (of target Post, Comment, Message, Network, Media)

Parameters:

{target_type} required string target type (e.g. 'post', 'comment', etc)
{target_uuid} required string target uuid
language optional string language code

Returns: mixed

Sample response:

{
    "status": "OK",
    "data":[
        {"user_uuid": "4622f77e-27f8-11e6-98d1-54bef75c7a3f", "fullname": "Simpson Homer", "avatar": "http://api.socialveo.dev//data/4631a06c-27f8-11e6-94b3-54bef75c7a3f/bbe4cc0da7651ede420d8bfd32b4c1b9.jpg",…},
        {"user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f", "fullname": "Andy Izman", "avatar": "http://api.socialveo.dev//data/a66b8654-14a8-11e6-af87-54bef75c7a3f/ed33d2d155baffbd2c5c2231761ee411.jpg",…}
        ...
    ],
    "counts":{"sad": 1, "like": 1, "angry": 0, "boring": 0, "love": 0,…},
    "count":{"offset": 0, "limit": 10, "total": 12},
    "timestamp": 1234567890
}

public mixed deleteAction ( $target_type, $target_uuid )
$target_type string

Target type

$target_uuid string

Target uuid

listAction() public method

Return a lists of emotions associated with the given target_type

/emotions/{target_type}/{target_uuid}

Method: GET

Access: OwnerTarget || UserHasAccessTarget

Parameters:

{target_type} required string target type (e.g. 'post', 'comment', etc)
{target_uuid} required string target uuid
page or offset optional integer page start or offset
limit optional integer page limit
sortby[property]=order optional array sort by property value, order either desc or asc
filterby[property][operator]=value optional array filter by given property, operator eq (=), gt (>), ge(>=), lt(<), le(<=), ne(<>), like
emotion optional string filter by emotion, defined in config, (default is sad, like, angry, boring, love, dislike)
language optional string language code

Filter by: TagAssociation

Returns: array[]

Sample response:

{
    "status": "OK",
    "data":[
        {"user_uuid": "4622f77e-27f8-11e6-98d1-54bef75c7a3f", "fullname": "Simpson Homer", "avatar": "http://api.socialveo.dev//data/4631a06c-27f8-11e6-94b3-54bef75c7a3f/bbe4cc0da7651ede420d8bfd32b4c1b9.jpg",…},
        {"user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f", "fullname": "Andy Izman", "avatar": "http://api.socialveo.dev//data/a66b8654-14a8-11e6-af87-54bef75c7a3f/ed33d2d155baffbd2c5c2231761ee411.jpg",…}
        ...
    ],
    "counts":{"sad": 1, "like": 1, "angry": 0, "boring": 0, "love": 0,…},
    "count":{"offset": 0, "limit": 10, "total": 12},
    "timestamp": 1234567890
}

public mixed listAction ( $target_type, $target_uuid )
$target_type string

Target type

$target_uuid string

Target uuid

manageAction() public method

Create/update/delete emotions associated with the given target_type

/emotions/{target_type}/{target_uuid}/manage

Method: POST

Access: OwnerTarget || UserHasAccessTarget (of target Post, Comment, Message, Network, Media)

Parameters:

{target_type} required string target type (e.g. 'post', 'comment', etc)
{target_uuid} required string target uuid
emotion optional string emotion what you want set, defined in config (default is sad, like, angry, boring, love, dislike)
language optional string language code

Returns: mixed

Sample response:

{
    "status": "OK",
    "data":[
        {"user_uuid": "4622f77e-27f8-11e6-98d1-54bef75c7a3f", "fullname": "Simpson Homer", "avatar": "http://api.socialveo.dev//data/4631a06c-27f8-11e6-94b3-54bef75c7a3f/bbe4cc0da7651ede420d8bfd32b4c1b9.jpg",…},
        {"user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f", "fullname": "Andy Izman", "avatar": "http://api.socialveo.dev//data/a66b8654-14a8-11e6-af87-54bef75c7a3f/ed33d2d155baffbd2c5c2231761ee411.jpg",…}
        ...
    ],
    "counts":{"sad": 1, "like": 1, "angry": 0, "boring": 0, "love": 0,…},
    "count":{"offset": 0, "limit": 10, "total": 12},
    "timestamp": 1234567890
}

public mixed manageAction ( $target_type, $target_uuid )
$target_type string

Target type

$target_uuid string

Target uuid