Was this helpful?
Yes
No

Setup

To use the JoinGroupRequests API, install the @wix/groups package using npm or Yarn:

Copy
1
npm install @wix/groups

or

Copy
1
yarn add @wix/groups

Then import { joinGroupRequests } from @wix/groups:

Copy
1
import { joinGroupRequests } from '@wix/groups'
Was this helpful?
Yes
No

approveJoinGroupRequests( )

Approves requests to join a group.

Note: This function is only relevant for private groups.

The approvejoinGroupRequests() function returns a Promise that resolves when a site member's request to join a group is approved. Only site admins and group admins can approve site member requests to join a group, unless the group setting, membersCanApprove is set to true.

Copy
function approveJoinGroupRequests(groupId: string, memberIds: Array<string>, options: ApproveJoinGroupRequestsOptions): Promise<ApproveJoinGroupRequestsResponse>
Method Parameters
groupIdstringRequired
ID of the group requested to join.

memberIdsArray<string>Required
IDs of the site members to approve.

optionsApproveJoinGroupRequestsOptions
Returns
Return Type:Promise<ApproveJoinGroupRequestsResponse>
Was this helpful?
Yes
No

listJoinGroupRequests( )

Lists requests to join a group.

Note: This function is only relevant for private groups.

The listjoinGroupRequests() function returns a Promise that resolves to a list of up to 100 requests to join a group. Sorts by default to _createdDate in descending order. Only site admins and group admins can see requests to join their group. Site members can access their own join requests in their site.

Notes:

Copy
function listJoinGroupRequests(groupId: string, options: ListJoinGroupRequestsOptions): Promise<ListJoinGroupRequestsResponse>
Method Parameters
groupIdstringRequired
ID of the group requested to join.

optionsListJoinGroupRequestsOptions
Returns
Return Type:Promise<ListJoinGroupRequestsResponse>
Was this helpful?
Yes
No

queryJoinGroupRequests( )

Creates a query to retrieve a list of join requests.

Notes:

  • This function is only relevant for private groups.
  • For SECRET groups, only site admins and group admins can query requests to join their group.

The queryjoinGroupRequests() function builds a query to retrieve a list of all requests to join a group, and returns a joinGroupRequestsQueryBuilder object.

The returned object contains the query definition which is typically used to run the query using the find() function.

You can refine the query by chaining joinGroupRequestsQueryBuilder functions onto the query. joinGroupRequestsQueryBuilder functions enable you to sort, filter, and control the results that queryjoinGroupRequests() returns.

The results of the queryjoinGroupRequests() function are sorted by _createdDate in descending order.

queryjoinGroupRequests() runs with this joinGroupRequestsQueryBuilder default, which you can override:

The following joinGroupRequestsQueryBuilder functions are supported for queryjoinGroupRequests(). For a full description of the joinGroupRequests object, see the object returned for the items property in joinGroupRequestsQueryResult.

PropertySupported Filters & Sorting
statuseq(), ne(), hasSome(), or()
PROPERTYSUPPORTED FILTERS & SORTING
statuseq(),ne(),exists(),in(),hasSome()
Copy
function queryJoinGroupRequests(groupId: string, options: QueryJoinGroupRequestsOptions): JoinGroupRequestsQueryBuilder
Method Parameters
groupIdstringRequired
Group ID.

optionsQueryJoinGroupRequestsOptions
Was this helpful?
Yes
No

rejectJoinGroupRequests( )

Rejects requests to join a group.

Note: This function is only relevant for private groups.

The rejectjoinGroupRequests() function returns a Promise that resolves when the site member's request to join a group is rejected. Only site admins or group admins can reject site member requests to join the group, unless the group setting, membersCanApprove is set to true.

Copy
function rejectJoinGroupRequests(groupId: string, rejections: Array<Rejection>): Promise<RejectJoinGroupRequestsResponse>
Method Parameters
groupIdstringRequired
ID of the group requested to join.

rejectionsArray<Rejection>Required
Rejection data.
Returns
Return Type:Promise<RejectJoinGroupRequestsResponse>
Was this helpful?
Yes
No