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
sendReportSends notification to site administrator.uploadImageDownloads image to a temporary directory.getImagesGets image list.
Users
getActivityGets a list of activity for specified user.addFriendCreates friend request and subscribes to user. Or subscribes and accepts friend request if a user ID has sent the same request to this user.getFollowsReturns a list of users which user follows.getFollowersReturns a list of users who follows a user.followSubscribes to a specified user.unfollowUnsubsribes from specified user.searchAllows to search users by first and last name.getReturns a list of users, sorting order is shown in the plugin settings.changeCoverChanges cover of current user.removeCoverRemoves cover of current user.changeAvatarChanges avatar of current user.removeAvatarRemoves avatar of current user.saveFieldSaves specified field with information about a user.getFriendsReturns user’s friend list.getFriendshipRequestsReturns user’s friend requests.updatePrivacyUpdates user’s privacy settings.changeEmailChanges user’s email.changePasswordChanges user’s password.deleteAccountRemoves user’s account.getPostsReturns a list of user’s posts.getCommentsReturns a list of user’s comments.
Groups
getActivityGets activity list of specified group.postActivityMakes a post on a group page.removeActivityRemoves post from a group page.changeLogoChanges group logo.removeLogoRemoves group logo.changeCoverChanges group cover.removeCoverRemoves group cover.joinCreates request to join a group if a group is “Closed” type, or joins the group if the group is “Open” type. Also confirms group invitationleaveCancels 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.deleteRemoves group. Available only for a user with a role of a group administrator.followSubscribes user to specified group.unfollowUnsubsribes user from a specified group.getUsersReturns a list of users related to a group.removeUserRemoves user/users from a group and blocks them due to mentioned parameter.unblockUserUnblocks user in a group.approveUserConfirms membership request from a user.getUsersToInviteReturns a list of users who are not a group members and are not invited yet, if the groupId parameter is specified.inviteSends an invitation to a user to join a group.cancelInviteRemoves or calcels invitation to join a group.updatePrivacyUpdates group’s privacy settings.updateDataUpdates group data.getReturns a list of groups.getUserGroupsReturns a list of groups of a current user.createGroupCreates new group.blockBlocks a group.unblockUnblocks a group.
.
Activity
getReturns a list of posts related to a current user.postPublishes a new post on a page of specified user.updateUpdates post on a page of specified user.removeRemoves user’s post.shareCopies (shares) certain post and displays it as a post of current user.likePuts “Like” for a certain post.unlikeRemoves “Like” for a certain post.getLikesGets a list of users who clicked “Like”.getSharesGets a list of users who shared post.parseUrlAttachmentGets Open Graph data by a link.searchSearch posts.
Messages
createConversationCreates new conversation.getMessagesGets messages in a certain conversation.checkUnreadMessagesChecks conversation of a current user if there are new messages.sendMessageSends messages to all members of a conversation.sendMessageToUserSends message to a certain user.deleteMessagesRemoves specified messages from a conversation.deleteConversationRemoves specified conversation.blockUserBlocks receiving messages from a specified user.unblockUserUnblocks receiving messages from a specified user.
Comments
getGets comments for a certain post.postPublishes new comment.updateUpdates content of a comment.removeRemoves comment.replyPublishes reply to a comment.repliesGets replies to a comment of a certain comment.
Notifications
getGets a list of notifications for a current user.setViewedSets “viewed” status for a certain notification.setViewedAllSets “viewed” status for all notifications.
remove Removes certain notification.