> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # QueryJoinGroupRequests # Package: memberManagement # Namespace: JoinGroupRequestsService # Method link: https://dev.wix.com/docs/api-reference/crm/community/groups/member-management/join-requests/query-join-group-requests.md ## Introduction Retrieves a list of up to 100 join group requests, given the provided paging and filtering. Group managers always have access to this functionality (site members can access their own join group requests in the site). Supported fields for filtering: - `status` No supported fields for sorting --- ## REST API ### Schema ``` Method: queryJoinGroupRequests Description: Retrieves a list of up to 100 join group requests, given the provided paging and filtering. Group managers always have access to this functionality (site members can access their own join group requests in the site). Supported fields for filtering: - `status` No supported fields for sorting URL: https://www.wixapis.com/v2/groups/{groupId}/join-requests/query Method: POST Method parameters: param name: query | type: Query - name: filter | type: Value | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` - ONE-OF: - name: nullValue | type: | description: - name: numberValue | type: number | description: - name: stringValue | type: string | description: - name: boolValue | type: boolean | description: - name: structValue | type: object | description: - name: listValue | type: ListValue | description: - name: values | type: array | description: - name: sort | type: array | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC - name: paging | type: Paging | description: Paging options to limit and skip the number of items. - name: limit | type: integer | description: Number of items to load. - name: offset | type: integer | description: Number of items to skip in the current sort order. - name: fields | type: array | description: Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. - name: fieldsets | type: array | description: Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. Return type: QueryJoinGroupRequestsResponse - name: joinGroupRequests | type: array | description: Join group requests. - name: siteMemberId | type: string | description: Member GUID. See the Members API for more details. - name: contactId | type: string | description: Contact GUID. See the Contacts API for more details. - name: status | type: RequestStatus | description: Join group request status. - enum: - PENDING: Pending group request. - APPROVED: Approved group request. - REJECTED: Rejected group request. - CANCELED: Canceled group request. - name: requestDetails | type: RequestDetails | description: Join group request details. - name: rejectionReason | type: string | description: Reason the request has been rejected. - name: metadata | type: PagingMetadata | description: - name: count | type: integer | description: Number of items returned in the response. - name: offset | type: integer | description: Offset that was requested. - name: total | type: integer | description: Total number of items that match the query. - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field. ``` ### Examples ### QueryJoinGroupRequests ```curl ~~~cURL curl -X POST \ https://wixapis.com/social-groups/v2/groups/a4caf853-c0d7-498e-8eaa-3db36522dcbf/join-requests/query \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' -d '{ "ownershipFilter": "CURRENT_MEMBER", "query": { "filter": { "status": { "$eq": "APPROVED" } }, "paging": { "offset": 0, "limit": 100 } } }' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.memberManagement.JoinGroupRequestsService.queryJoinGroupRequests(groupId, options) Description: Retrieves a list of up to 100 join group requests, given the provided paging and filtering. Group managers always have access to this functionality (site members can access their own join group requests in the site). Supported fields for filtering: - `status` No supported fields for sorting # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: groupId Method parameters: param name: groupId | type: string | description: GUID of the group requested to join. | required: true param name: options | type: QueryJoinGroupRequestsOptions none - name: query | type: Query | description: - name: filter | type: Value | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` - ONE-OF: - name: nullValue | type: | description: - name: numberValue | type: number | description: - name: stringValue | type: string | description: - name: boolValue | type: boolean | description: - name: structValue | type: object | description: - name: listValue | type: ListValue | description: - name: values | type: array | description: - name: sort | type: array | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC - name: paging | type: Paging | description: Paging options to limit and skip the number of items. - name: limit | type: integer | description: Number of items to load. - name: offset | type: integer | description: Number of items to skip in the current sort order. - name: fields | type: array | description: Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. - name: fieldsets | type: array | description: Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. Return type: PROMISE - name: joinGroupRequests | type: array | description: Join group requests. - name: siteMemberId | type: string | description: Member GUID. See the Members API for more details. - name: contactId | type: string | description: Contact GUID. See the Contacts API for more details. - name: status | type: RequestStatus | description: Join group request status. - enum: - PENDING: Pending group request. - APPROVED: Approved group request. - REJECTED: Rejected group request. - CANCELED: Canceled group request. - name: requestDetails | type: RequestDetails | description: Join group request details. - name: rejectionReason | type: string | description: Reason the request has been rejected. - name: metadata | type: PagingMetadata | description: - name: count | type: integer | description: Number of items returned in the response. - name: offset | type: integer | description: Offset that was requested. - name: total | type: integer | description: Total number of items that match the query. - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field. ``` ### Examples ### Query requests to join a group (with elevated permissions) ```javascript import { joinGroupRequests } from '@wix/groups'; import { auth } from '@wix/essentials'; const elevatedQueryJoinGroupRequests = auth.elevate(joinGroupRequests.queryJoinGroupRequests); export function myQueryJoinGroupRequestsFunction() { return elevatedQueryJoinGroupRequests(groupId, options) .find() .then((results) => { const items = results.items; const firstItem = items[0]; const pageSize = results.pageSize; const totalPages = results.totalPages; const totalCount = results.totalCount; const currentPage = results.currentPage; const next = results.next(); const previous = results.prev(); const hasNext = results.hasNext(); const hasPrev = results.hasPrev(); const length = results.length; return items; }) .catch((error) => { console.error(error); }); } /* Returns items: * [ * { * "memberId": "7fe8e9e1-d050-4c86-9684-e7f231600a34" * "_createdDate": "Fri Oct 24 2021 22:45:50 GMT+0300" * "status": "PENDING" * }, * { * "memberId": "937cd3db-e9be-4980-93c1-a6d767a11050" * "_createdDate": "Wed May 14 2021 10:05:20 GMT+0300" * "status": "REJECTED" * "rejectionReason": "Wrong group" * }, * { * "memberId": "2CD58761-d050-4c86-9684-e7f2316229b3" * "_createdDate": "Sun July 11 2020 03:25:30 GMT+0300" * "status": "APPROVED" * } * ] */ ``` ### Query requests to join a group ```javascript import { joinGroupRequests } from '@wix/groups'; export function myQueryJoinGroupRequestsFunction() { return joinGroupRequests.queryJoinGroupRequests(groupId, options) .find() .then((results) => { const items = results.items; const firstItem = items[0]; const pageSize = results.pageSize; const totalPages = results.totalPages; const totalCount = results.totalCount; const currentPage = results.currentPage; const next = results.next(); const previous = results.prev(); const hasNext = results.hasNext(); const hasPrev = results.hasPrev(); const length = results.length; return items; }) .catch((error) => { console.error(error); }); } /* Returns items: * [ * { * "memberId": "7fe8e9e1-d050-4c86-9684-e7f231600a34" * "_createdDate": "Fri Oct 24 2021 22:45:50 GMT+0300" * "status": "PENDING" * }, * { * "memberId": "937cd3db-e9be-4980-93c1-a6d767a11050" * "_createdDate": "Wed May 14 2021 10:05:20 GMT+0300" * "status": "REJECTED" * "rejectionReason": "Wrong group" * }, * { * "memberId": "2CD58761-d050-4c86-9684-e7f2316229b3" * "_createdDate": "Sun July 11 2020 03:25:30 GMT+0300" * "status": "APPROVED" * } * ] */ ``` ### queryJoinGroupRequests (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { joinGroupRequests } from '@wix/groups'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { joinGroupRequests }, // Include the auth strategy and host as relevant }); async function queryJoinGroupRequests(groupId,options) { const response = await myWixClient.joinGroupRequests.queryJoinGroupRequests(groupId,options); }; ``` ---