API > Activity

Basic JavaScript object

get

Returns list of post related to current user.

Parameters

  • limit
    Maximum number of posts which has to be returned. By default 5, minumum value 1, maximum value 20.
  • offsetId
    Post ID regarding to which a list will be displayed in descending order.

Result

Returns object with properties success and html:

  • success
    Request status true in a case of success or false in a case of error.
  • html
    Template render membership-by-supsystic/src/Membership/Activity/views/partials/activities.twig

Example


post

Publishes new post on the page of specified user.

Parameters

  • userId
    User ID for which is needed to publish a post.

  • data
    Object with properties for publication

    Available properties:

    • message
      Message text
    • link
      Link ID to display in the post, can be received after the method call
      parseUrlAttachment
    • images
      Image ID array which has to be attached to the post, can be received after the call uploadImage

Result

Returns object with properties success and html:

  • success
    Request status true in a case of success or false in a case of error.
  • html
    Template render membership-by-supsystic/src/Membership/Activity/views/partials/activities.twig

Example


update

Updates post on the page of specified user.

Parameters

  • activityId
    Post ID which has to be updated.

  • data
    Object with properties for publication

    Available properties:

    • message
      Message text
    • link
      Link ID to display in the post, can be received after the method call parseUrlAttachment

Result

Returns object with properties success and html:

  • success
    Request status true in a case of success or false in a case of error.
  • html
    Template render membership-by-supsystic/src/Membership/Activity/views/partials/activities.twig

Example


remove

Removes user post.

Parameters

  • activityId
    ID of a post which has to be deleted.

Result

Returns object with success property:

  • success
    Request status true in a case of success or false in a case of error.

Example


share

Copies (shares) certain post and displays it as a post of a current user.

Parameters

  • activityId
    ID of a post which has to be copied (shared).

Result

Returns object with properties success and html:

  • success
    Request status true in a case of success or false in a case of error.
  • html
    Template render membership-by-supsystic/src/Membership/Activity/views/partials/activity-action-popup-user.twig

Example


like

Puts "Like" for the certain post.

Parameters

  • activityId
    ID of a post which has to be copied (shared).

Result

Returns object with properties success и html or error:

  • success
    Request status true in a case of success or false in a case of error.
  • html
    Template render membership-by-supsystic/src/Membership/Activity/views/partials/activity-action-popup-user.twig
  • message
    Error message in a case of unseccessful request.

Example


unlike

Removes "Like" for the certain post.

Parameters

  • activityId
    Post ID.

Result

Returns object with properties success and html or error:

  • success
    Request status true in a case of success or false in a case of error.
  • html
    Template render membership-by-supsystic/src/Membership/Activity/views/partials/activity-action-popup-user.twig
  • message
    Error message in a case of unseccessful request.

Example


getLikes

Gets a list of users who clicked "Like".

Parameters

  • activityId
    Post ID.

  • limit
    Maximum number of users which has to be returned. By default 15, minumum value 1, maximum value 50.

  • offsetId
    User ID regarding to which a list will be displayed in descending order.

  • template
    A template with the help of which a list be rendered.

    Acceptable values

    • modal will be rendered membership-by-supsystic/src/Membership/Activity/views/partials/activity-action-modal-user.twig
    • popup will be rendered membership-by-supsystic/src/Membership/Activity/views/partials/activity-action-popup-user.twig

Result

Returns object with properties success and html or error:

  • success
    Request status true in a case of success or false in a case of error.
  • html template render membership-by-supsystic/src/Membership/Activity/views/partials/activity-action-modal-user.twig or
    membership-by-supsystic/src/Membership/Activity/views/partials/activity-action-popup-user.twig
  • message
    Error message in a case of unseccessful request.

Example


getShares

Gets list of users who shared a post.

Parameters

  • activityId
    Post ID.

  • limit
    Maximum number of users which has to be returned. By default 15, minumum value 1, maximum value 50.

  • offsetId
    User ID regarding to which a list will be displayed in descending order.

  • template
    A template with the help of which a list be rendered.

    Acceptable values

    • modal will be rendered membership-by-supsystic/src/Membership/Activity/views/partials/activity-action-modal-user.twig
    • popup will be rendered membership-by-supsystic/src/Membership/Activity/views/partials/activity-action-popup-user.twig

Result

Returns object with properties success and html or error:

  • success
    Request status true in a case of success or false in a case of error.
  • html template render membership-by-supsystic/src/Membership/Activity/views/partials/activity-action-modal-user.twig or
    membership-by-supsystic/src/Membership/Activity/views/partials/activity-action-popup-user.twig
  • message
    Error message in a case of unseccessful request.

Example


parseUrlAttachment

Gets Open Graph data by the link.

Parameters

  • url
    Url address.

Result

Returns object with properties success and html or error:

  • success
    Request status true in a case of success or false in a case of error.
  • html template render membership-by-supsystic/src/Membership/Activity/views/partials/activity-attachment-link.twig
  • message Error message is a case of unseccessful request.

Example


Search through posts.

Parameters

  • query
    Query line
  • type
    If query type is hash search will be made by hashtags, if type is not specified then search will be made by posts text.
  • limit
    Maximum number of posts which has to be returned. By default 5, minumum value 1, maximum value 20.
  • offsetId
    Post ID regarding to which a list will be displayed in descending order.

Result

Returns object with properties success and html or error:

  • success
    Request status true in a case of success or false in a case of error.
  • html template render membership-by-supsystic/src/Membership/Activity/views/partials/activities.twig

Example


Categories
Latest Articles
Get plugins bundle today and save over 80%