Class Socialveo\WebApi\Controllers\SpamController

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

Class SpamController

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 spam resource Socialveo\WebApi\Controllers\SpamController
encrypt() Encrypt value Socialveo\WebApi\Controllers\RestApiController
getAction() Returns a spam resource Socialveo\WebApi\Controllers\SpamController
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
getTargetAction() Get spam resource by target Socialveo\WebApi\Controllers\SpamController
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() Returns a list of spam resources Socialveo\WebApi\Controllers\SpamController
notFoundAction() Not found action Socialveo\WebApi\Controllers\RestApiController
posts() Gets posts Socialveo\WebApi\Controllers\RestApiController
replaceParam() Replace param Socialveo\WebApi\Controllers\RestApiController
reportAction() Report a spam Socialveo\WebApi\Controllers\SpamController
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 spam resource Socialveo\WebApi\Controllers\SpamController

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 spam resource

/spam/{spam_uuid}/delete

Method: POST

Access: Owner

Parameters:

{spam_uuid} required string spam uuid
language optional string language code

Affects: Spam

Sample response:

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

public mixed deleteAction ( $spam_uuid )
$spam_uuid string

Spam uuid

getAction() public method

Returns a spam resource

/spam/{spam_uuid}

Method: GET

Access: Owner

Parameters:

{spam_uuid} required string spam uuid
language optional string language code

Returns: Spam

Sample response:

{
    "status": "OK",
    "data":{
        'uuid': '0d76c9e0-b5f9-11e4-9f4b-b88d1200a92c',
        'user_uuid': '0bb0c9f8-b5f9-11e4-b2e9-b88d1200a92c',
        'target_type': 'post',
        'target_uuid': '0be7129c-b5f9-11e4-bb84-b88d1200a92c',
        ...
    },
    "timestamp": 1234567890
}

public mixed getAction ( $spam_uuid )
$spam_uuid string

Spam uuid

getTargetAction() public method

Get spam resource by target

/spam/target

Method: GET

Access: Logged && RequireTarget && NotOwnerTarget && UserHasAccessTarget

Parameters:

target_uuid required string target uuid
target_type required string target type
language optional string language code

Returns: Spam

Sample response:

{
    "status": "OK",
    "data":{
        'uuid': '0d76c9e0-b5f9-11e4-9f4b-b88d1200a92c',
        'user_uuid': '0bb0c9f8-b5f9-11e4-b2e9-b88d1200a92c',
        'target_type': 'post',
        'target_uuid': '0be7129c-b5f9-11e4-bb84-b88d1200a92c',
        ...
    },
    "timestamp": 1234567890
}

public mixed getTargetAction ( )
listAction() public method

Returns a list of spam resources

/spam

Method: GET

Access: Public

Parameters:

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 (limit results) by given property, operator eq (=), gt (>), ge(>=), lt(<), le(<=), ne(<>), like
uuids optional array or string list of item UUIDs to fetch, array or string separated by commas, when it used other parameters will be ignored
language optional string language code

Filter by: Spam

Returns: Spam []

Sample response:

{
    "status": "OK",
    "data":[
        {"type": "spam", "uuid": "82a6902c-a1c2-11e6-a8fe-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
        {"type": "spam", "uuid": "7e5381ce-a1c2-11e6-8be9-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
        {"type": "spam", "uuid": "6bb29956-a1c2-11e6-902b-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
        {"type": "spam", "uuid": "27c67934-775a-11e6-a6ea-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
        ...
    ],
    "count":{ "offset": 0, "limit": 10, "total": 41 },
    "timestamp": 1234567890
}

public mixed listAction ( )
reportAction() public method

Report a spam

/spam/report

Method: POST

Access: Logged && RequireTarget && NotOwnerTarget && UserHasAccessTarget

Parameters:

target_type required string target type
target_uuid required string target uuid
type optional string spam type
language optional string language code

Affects: Spam

Returns: Spam

Sample response: ```json

{ "status": "OK", "data":{ 'uuid': '0d76c9e0-b5f9-11e4-9f4b-b88d1200a92c', 'user_uuid': '0bb0c9f8-b5f9-11e4-b2e9-b88d1200a92c', 'target_type': 'post', 'target_uuid': '0be7129c-b5f9-11e4-bb84-b88d1200a92c', ... }, "timestamp": 1234567890 }

public mixed reportAction ( )
throws Exception
updateAction() public method

Updates a spam resource

/spam/{spam_uuid}/update

Method: POST

Access: Owner

Parameters:

{spam_uuid} required string spam uuid
spam_type optional string spam type
language optional string language code

Affects: Spam

Returns: Spam

Sample response:

{
    "status": "OK",
    "data":{
        'uuid': '0d76c9e0-b5f9-11e4-9f4b-b88d1200a92c',
        'user_uuid': '0bb0c9f8-b5f9-11e4-b2e9-b88d1200a92c',
        'target_type': 'post',
        'target_uuid': '0be7129c-b5f9-11e4-bb84-b88d1200a92c',
        ...
    },
    "timestamp": 1234567890
}

public mixed updateAction ( $spam_uuid )
$spam_uuid string

Spam uuid