Class Socialveo\WebApi\Controllers\NotificationsController

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

Class NotificationsController

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
connectionsAction() Get notifications of connection widget Socialveo\WebApi\Controllers\NotificationsController
decrypt() Decrypt value Socialveo\WebApi\Controllers\RestApiController
deleteAction() Remove notification Socialveo\WebApi\Controllers\NotificationsController
encrypt() Encrypt value Socialveo\WebApi\Controllers\RestApiController
genericAction() Get notifications of generic widget Socialveo\WebApi\Controllers\NotificationsController
getAction() Get notification Socialveo\WebApi\Controllers\NotificationsController
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() Get user notifications Socialveo\WebApi\Controllers\NotificationsController
messagesAction() Get notifications of messages widget Socialveo\WebApi\Controllers\NotificationsController
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

connectionsAction() public method

Get notifications of connection widget

/notifications/connections

Method: GET

Access: Logged

  • Parameters:

    language optional string language code

    Returns: Notification []

    Note. Widget will inject additional parsed_data option into attribute properties of notification
    with useful data of the parsed message option

    Sample response: ```json

    { "status": "OK", "data":[ {"type": "notification", "uuid": "1eb4ba1e-6f1f-11e7-8191-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…}, {"type": "notification", "uuid": "37bf04aa-6e8a-11e7-92aa-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…}, {"type": "notification", "uuid": "c7328346-6b33-11e7-b3c9-54bef75c7a3f", "user_uuid": "4622f77e-27f8-11e6-98d1-54bef75c7a3f",…}, {"type": "notification", "uuid": "5098aa9c-6ac2-11e7-8b6f-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…}, ... ], "count":{ "offset": 0, "limit": 10, "total": 12 }, "timestamp": 1234567890 }
public mixed connectionsAction ( )
deleteAction() public method

Remove notification

/notifications/{notification_uuid}/delete

Method: POST

Access: Owner

  • Parameters:

    {notification_uuid} required string notification uuid

    Affects: Notification

    Sample response:

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

public mixed deleteAction ( $notification_uuid )
$notification_uuid string

Notification uuid

genericAction() public method

Get notifications of generic widget

/notifications/generic

Method: GET

Access: Logged

  • Parameters:

    language optional string language code

    Returns: Notification []

    Note. Widget will inject additional parsed_data option into attribute properties of notification
    with useful data of the parsed message option

    Sample response: ```json

    { "status": "OK", "data":[ {"type": "notification", "uuid": "1eb4ba1e-6f1f-11e7-8191-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…}, {"type": "notification", "uuid": "37bf04aa-6e8a-11e7-92aa-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…}, {"type": "notification", "uuid": "c7328346-6b33-11e7-b3c9-54bef75c7a3f", "user_uuid": "4622f77e-27f8-11e6-98d1-54bef75c7a3f",…}, {"type": "notification", "uuid": "5098aa9c-6ac2-11e7-8b6f-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…}, ... ], "count":{ "offset": 0, "limit": 10, "total": 12 }, "timestamp": 1234567890 }
public mixed genericAction ( )
getAction() public method

Get notification

/notifications/{notification_uuid}

Method: GET

Access: Owner

  • Parameters:

    {notification_uuid} required string notification uuid
    language optional string language code

    Returns: Notification

    Sample response:

    {
        "status": "OK",
        "data":[
            {"type": "notification", "uuid": "1eb4ba1e-6f1f-11e7-8191-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
            {"type": "notification", "uuid": "37bf04aa-6e8a-11e7-92aa-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
            {"type": "notification", "uuid": "c7328346-6b33-11e7-b3c9-54bef75c7a3f", "user_uuid": "4622f77e-27f8-11e6-98d1-54bef75c7a3f",…},
            {"type": "notification", "uuid": "5098aa9c-6ac2-11e7-8b6f-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
            ...
        ],
        "timestamp": 1234567890
    }

public mixed getAction ( $notification_uuid )
$notification_uuid string

Notification uuid

listAction() public method

Get user notifications

/notifications

Method: GET

Access: Logged

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
language optional string language code

Filter by: Notification

Returns: Notification []

Sample response:

{
    "status": "OK",
    "data":[
        {"type": "notification", "uuid": "93df5d7a-47fc-11e7-afa7-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
        {"type": "notification", "uuid": "0277ea8e-8b0d-11e6-9d45-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
        {"type": "notification", "uuid": "cbe4a70a-8b0c-11e6-b962-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
        {"type": "notification", "uuid": "d8ea373e-88f1-11e6-beea-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
        ...
    ],
    "count":{ "offset": 0, "limit": 10, "total": 12 },
    "timestamp": 1234567890
}

public mixed listAction ( )
messagesAction() public method

Get notifications of messages widget

/notifications/messages

Method: GET

Access: Logged

  • Parameters:

    language optional string language code

    Returns: Notification []

    Note. Widget will inject additional parsed_data option into attribute properties of notification
    with useful data of the parsed message option

    Sample response:

    {
        "status": "OK",
        "data":[
            {"type": "notification", "uuid": "1eb4ba1e-6f1f-11e7-8191-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
            {"type": "notification", "uuid": "37bf04aa-6e8a-11e7-92aa-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
            {"type": "notification", "uuid": "c7328346-6b33-11e7-b3c9-54bef75c7a3f", "user_uuid": "4622f77e-27f8-11e6-98d1-54bef75c7a3f",…},
            {"type": "notification", "uuid": "5098aa9c-6ac2-11e7-8b6f-54bef75c7a3f", "user_uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f",…},
            ...
        ],
        "count":{ "offset": 0, "limit": 10, "total": 12 },
        "timestamp": 1234567890
    }

public mixed messagesAction ( )