Class Socialveo\WebApi\Controllers\TagsController

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

Class TagsController

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
createAction() Creates a tag Socialveo\WebApi\Controllers\TagsController
decrypt() Decrypt value Socialveo\WebApi\Controllers\RestApiController
deleteAction() Removes a tag Socialveo\WebApi\Controllers\TagsController
encrypt() Encrypt value Socialveo\WebApi\Controllers\RestApiController
getAction() Returns a tag Socialveo\WebApi\Controllers\TagsController
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() Returns a list of tag Socialveo\WebApi\Controllers\TagsController
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 tag Socialveo\WebApi\Controllers\TagsController

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

createAction() public method

Creates a tag

Notice. This action is disabled, the reasons can be: not implemented, unsafe, duplicated or deprecated (autodetect: disabled in the router)
/tags/create

Method: POST

Parameters:

name required string name of the tag
tag_type required string type of tag hashtag or emotion or mention

Returns: Tag

Sample response:

{
    "status": "OK",
    "data":[
        "type": "tag_association",
        "uuid": "0aa7a1f8-b5f9-11e4-8cf7-b88d1200a92c",
        "name": "like",
        "tag_type": "emotion",
        "associations": [
             "e2730224-a1bd-3ec3-88b9-f0a73d6d1a0f",
             "f8b2c84b-aa4e-3d63-9fa8-95206dbd8b5e",
             "9a4f3e6d-580e-3d0f-abea-756129e11939"
        ],
        ...
    ],
    "timestamp": 1234567890
}

public mixed createAction ( )
deleteAction() public method

Removes a tag

Notice. This action is disabled, the reasons can be: not implemented, unsafe, duplicated or deprecated (autodetect: disabled in the router)
/tags/{uuid}/delete

Method: POST

Parameters: This action accepts no properties

Sample response:

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

public mixed deleteAction ( $tag_uuid )
$tag_uuid string

Tag UUID is passed in the request URI

getAction() public method

Returns a tag

/tags/{tag_uuid}

Method: GET

Access: Public

Parameters:

{tag_uuid} required string tag uuid

Returns: Tag

Sample response:

{
    "status": "OK",
    "data":[
        "type": "tag_association",
        "uuid": "0aa7a1f8-b5f9-11e4-8cf7-b88d1200a92c",
        "name": "like",
        "tag_type": "emotion",
        "associations": [
             "e2730224-a1bd-3ec3-88b9-f0a73d6d1a0f",
             "f8b2c84b-aa4e-3d63-9fa8-95206dbd8b5e",
             "9a4f3e6d-580e-3d0f-abea-756129e11939"
        ],
        ...
    ],
    "timestamp": 1234567890
}

public mixed getAction ( $tag_uuid )
$tag_uuid string

Tag UUID is passed in the request URI

listAction() public method

Returns a list of tag

/tags

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

Notes: When uuids param used then will be ignored others filter params

Filter by: Tag

Returns: Tag []

Sample response:

{
    "status": "OK",
    "data":[
        {"type": "tag", "uuid": "63db6e44-6cea-11e7-ab27-54bef75c7a3f", "name": "Simpson Homer",…},
        {"type": "tag", "uuid": "3e38b27a-6ce8-11e7-b71a-54bef75c7a3f", "name": "Little Helper Santa's",…},
        ...
    ],
    "count":{ "offset": 0, "limit": 10, "total": 12 },
    "timestamp": 1234567890
}

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

Updates a tag

Notice. This action is disabled, the reasons can be: not implemented, unsafe, duplicated or deprecated (autodetect: disabled in the router)
/tags/{tag_uuid}/update

PUT Parameters:

name required string name of the tag
tag_type required string type of tag hashtag or emotion or mention

Affects: Tag

Returns: Tag

Sample response:

{
    "status": "OK",
    "data":[
        "type": "tag_association",
        "uuid": "0aa7a1f8-b5f9-11e4-8cf7-b88d1200a92c",
        "name": "like",
        "tag_type": "emotion",
        "associations": [
             "e2730224-a1bd-3ec3-88b9-f0a73d6d1a0f",
             "f8b2c84b-aa4e-3d63-9fa8-95206dbd8b5e",
             "9a4f3e6d-580e-3d0f-abea-756129e11939"
        ],
        ...
    ],
    "timestamp": 1234567890
}

public mixed updateAction ( $tag_uuid )
$tag_uuid
throws Exception