API

In the plugin we use AJAX requests and render templates on a server side. All requests are made via global JavaScript object Membership.api.

API methods

Base

  • sendReport Sends notification to site administrator.
  • uploadImage Downloads image to a temporary directory.
  • getImages Gets image list.

Users

  • getActivity Gets a list of activity for specified user.
  • addFriend Creates friend request and subscribes to user. Or subscribes and accepts friend request if a user ID has sent the same request to this user.
  • getFollows Returns a list of users which user follows.
  • getFollowers Returns a list of users who follows a user.
  • follow Subscribes to a specified user.
  • unfollow Unsubsribes from specified user.
  • search Allows to search users by first and last name.
  • get Returns a list of users, sorting order is shown in the plugin settings.
  • changeCover Changes cover of current user.
  • removeCover Removes cover of current user.
  • changeAvatar Changes avatar of current user.
  • removeAvatar Removes avatar of current user.
  • saveField Saves specified field with information about a user.
  • getFriends Returns user’s friend list.
  • getFriendshipRequests Returns user’s friend requests.
  • updatePrivacy Updates user’s privacy settings.
  • changeEmail Changes user’s email.
  • changePassword Changes user’s password.
  • deleteAccount Removes user’s account.
  • getPosts Returns a list of user’s posts.
  • getComments Returns a list of user’s comments.

Groups

  • getActivity Gets activity list of specified group.
  • postActivity Makes a post on a group page.
  • removeActivity Removes post from a group page.
  • changeLogo Changes group logo.
  • removeLogo Removes group logo.
  • changeCover Changes group cover.
  • removeCover Removes group cover.
  • join Creates request to join a group if a group is “Closed” type, or joins the group if the group is “Open” type. Also confirms group invitation
  • .

  • leave Cancels membership request if a group is “Closed” type or removes current user from the group if the group is “Open” type. Also cancel group invitation.
  • delete Removes group. Available only for a user with a role of a group administrator.
  • follow Subscribes user to specified group.
  • unfollow Unsubsribes user from a specified group.
  • getUsers Returns a list of users related to a group.
  • removeUser Removes user/users from a group and blocks them due to mentioned parameter.
  • unblockUser Unblocks user in a group.
  • approveUser Confirms membership request from a user.
  • getUsersToInvite Returns a list of users who are not a group members and are not invited yet, if the groupId parameter is specified.
  • invite Sends an invitation to a user to join a group.
  • cancelInvite Removes or calcels invitation to join a group.
  • updatePrivacy Updates group’s privacy settings.
  • updateData Updates group data.
  • get Returns a list of groups.
  • getUserGroups Returns a list of groups of a current user.
  • createGroup Creates new group.
  • block Blocks a group.
  • unblock Unblocks a group.

Activity

  • get Returns a list of posts related to a current user.
  • post Publishes a new post on a page of specified user.
  • update Updates post on a page of specified user.
  • remove Removes user’s post.
  • share Copies (shares) certain post and displays it as a post of current user.
  • like Puts “Like” for a certain post.
  • unlike Removes “Like” for a certain post.
  • getLikes Gets a list of users who clicked “Like”.
  • getShares Gets a list of users who shared post.
  • parseUrlAttachment Gets Open Graph data by a link.
  • search Search posts.

Messages

  • createConversation Creates new conversation.
  • getMessages Gets messages in a certain conversation.
  • checkUnreadMessages Checks conversation of a current user if there are new messages.
  • sendMessage Sends messages to all members of a conversation.
  • sendMessageToUser Sends message to a certain user.
  • deleteMessages Removes specified messages from a conversation.
  • deleteConversation Removes specified conversation.
  • blockUser Blocks receiving messages from a specified user.
  • unblockUser Unblocks receiving messages from a specified user.

Comments

  • get Gets comments for a certain post.
  • post Publishes new comment.
  • update Updates content of a comment.
  • remove Removes comment.
  • reply Publishes reply to a comment.
  • replies Gets replies to a comment of a certain comment.

Notifications

  • get Gets a list of notifications for a current user.
  • setViewed Sets “viewed” status for a certain notification.
  • setViewedAll Sets “viewed” status for all notifications.

remove Removes certain notification.

Categories
Latest Articles