Two new endpoints have been added in the JSON API User Plus plugin for BuddyPress Groups component REST JSON API to get members and groups bringing the Groups loop and Members loop results in json api for your mobile app integration. Both of these endpoints can be used in variety of ways creatively, depending upon the provided params, and support all BuddyPress available parameters.
New endpoints:
Following is the detail of endpoints and available parameters.
1. members_bp_has_members
Based on the args
passed, members_bp_has_members gets a list of members.
Accepted Parameters / Options
-
type optional
Defines the type of users to return.
- Accepted arguments:
active
,newest
,popular
,online
,alphabetical
,random.
Default value:active
- Accepted arguments:
-
per_page optional
The number of users to display on a page before they are paginated to the next page . Default value: 20
-
page optional
The page number to display. Default value:
1
-
max optional
The total number of users to return. Default value:
false
(no limit) -
include optional
Pass a user_id or string of comma separated user_ids to return on these users. Default value:
false
-
exclude optional
Pass a user_id or string of comma separated user_ids to exclude those users in the return. Default value:
false
-
user_id optional
Limit the members returned to only friend connections of the logged in user. Default value:
false
-
search_terms optional
Return members that match these search terms. Default value:
false
-
meta_key optional
Only return users with this usermeta field. Default value:
false
-
meta_value optional
Only return users where the usermeta value matches. Requires meta_key. Default value:
false
-
populate_extras optional
Fetch extra meta for each user such as their full name, if they are a friend of the logged in user, their last activity time. Default value:
true
2. groups_bp_has_groups
Accepted Parameters / Options
This endpoint will accept a number of parameters that will manipulate the data being returned.
-
type optional
Defines the type of groups to return.
- Accepted arguments:
active
,newest
,popular
,random
,alphabetical
,most-forum-topics
,most-forum-posts.
Default value:active
- Accepted arguments:
-
per_page optional
The number of groups to display on a page before they are paginated to the next page. Default value:
10
-
page optional
The page to display. Default value:
1
-
max optional
The total number of groups to return. Default value:
false
(no limit) -
user_id optional
Return only groups that this user is a member of. Default value:
false
-
slug optional
Return only the group that matches this slug. Default value:
false
-
search_terms optional
Return only groups that match these search terms. Default value:
false
-
meta_query optional
Return only groups that match a meta key and value. Default value:
false
-
populate_extras optional
Fetch extra meta for each group such as if the logged in user is a member, or is banned. Default value:
true