listGroupRequests( )
Lists requests to create a group.
Description
The listGroupRequests()
function returns a Promise that resolves to a list of up to 1,000 create group requests on your site.
Using the options parameter, you can filter your list of posts, set the amount of posts to be returned, and sort your list in a specified order.
By default, the list is sorted by _createdDate
in descending order. Only admins can see create group requests. Members can access their own create group requests in their site.
Note: This function is only relevant if admin approval is required for creating a group.
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function listGroupRequests(options: ListGroupRequestsOptions): Promise<ListGroupRequestsResponse>
listGroupRequests Parameters
NAME
TYPE
DESCRIPTION
Paging options.
Returns
Return Type:
NAME
TYPE
DESCRIPTION
List of requests to create a group.
Paging information.
Was this helpful?
Lists requests to create a group
1import { createRequests } from 'wix-groups.v2';23export function myListGroupRequestsFunction() {4 return createRequests.listGroupRequests()5 .then((groupRequestsResults) => {6 const groupRequestStatus = groupRequestsResults.groupRequests[0].status;7 const groupRequestName = groupRequestsResults.cgroupRequests[0].group.name;8 return groupRequestsResults;9 })10 .catch((error) => {11 console.error(error);12 });13}1415/* Promise resolves to:16 * {17 * groupRequests: [18 * {19 * "_id": "83636377-b415-4ebe-ba41-df338c5ad6b7",20 * "status": "PENDING",21 * "group": {22 * "_id": "83636377-b415-4ebe-ba41-df338c5ad6b7",23 * "name": "My Group Request 1",24 * "slug": "my-group-request-1",25 * "description": "Welcome to the group! You can connect with other members, get updates and share videos.",26 * "privacyStatus": "PUBLIC",27 * "coverImage": {28 * "imageUrl": "wix:image://v1/22j9074e348009011fa9f2d2961b~mv2.jpg/corn.jpg#originWidth=112&originHeight=224",29 * "position": {30 * "x": 80,31 * "y": 5332 * }33 * }34 * "memberTitle": "Employees",35 * "memberCount": 1,36 * "settings": {37 * "groupDetailsChangedPostEnabled": true,38 * "membersCanApprove": false,39 * "membersCanInvite": true,40 * "showMemberList": true,41 * "welcomeMemberPostEnabled": true42 * }43 * "lastActivityDate": "Sun Sep 26 2021 08:23:23 GMT+0300",44 * "_createdDate": "Tues January 22 2021 12:56:02 GMT+0300",45 * "_updatedDate": "Fri October 2 2021 04:56:22 GMT+0300",46 * "owner": "9ne8e9e1-d050-4c86-9684-e7f231600a34"47 * }48 * },49 * {50 * "_id": "6ff5333-b477-4e9tt-ba4j-df338c5ad6221",51 * "status": "APPROVED",52 * "group": {53 * "_id": "6ff5333-b477-4e9tt-ba4j-df338c5ad6221",54 * "name": "My Group Request 2",55 * "slug": "my-group-request-2",56 * "description": "Welcome to the group! You can connect with other members, get updates and share videos.",57 * "privacyStatus": "PRIVATE",58 * "coverImage": {59 * "imageUrl": "wix:image://v1/664e64e348009011fa9f2d2961e~mv2.jpg/time.jpg#originWidth=2922&originHeight=778",60 * "position": {61 * "x": 0,62 * "y": 063 * }64 * }65 * "memberTitle": "Friends",66 * "memberCount": 65,67 * "settings": {68 * "groupDetailsChangedPostEnabled": true,69 * "membersCanApprove": true,70 * "membersCanInvite": true,71 * "showMemberList": false,72 * "welcomeMemberPostEnabled": true,73 * }74 * "lastActivityDate": "Thurs Nov 12 2020 11:13:03 GMT+0300",75 * "_createdDate": "Wed May 14 2020 10:05:20 GMT+0300",76 * "_updatedDate": "Sun June 7 2020 09:07:33 GMT+0300",77 * "owner": "abe5e4e1-d950-4c46-8884-e7f231600d67"78 * }79 * },80 * {81 * "_id": "57vn211-b477-4e9tt-ba4j-df338c5adf337",82 * "status": "REJECTED",83 * "rejectionReason": "This group has inappropriate content.",84 * "group": {85 * "_id": "57vn211-b477-4e9tt-ba4j-df338c5adf337",86 * "name": "My Group Request 3",87 * "slug": "my-group-request-3",88 * "description": "Welcome to the group! You can connect with other members, get updates and share videos.",89 * "privacyStatus": "PRIVATE",90 * "coverImage": {91 * "imageUrl": "wix:image://v1/ff9074e348009011fa9f2d2961b~mv2.jpg/popcorn.jpg#originWidth=712&originHeight=667",92 * "position": {93 * "x": 44,94 * "y": 1595 * }96 * }97 * "memberTitle": "Students",98 * "memberCount": 1,99 * "settings": {100 * "groupDetailsChangedPostEnabled": true,101 * "membersCanApprove": true,102 * "membersCanInvite": true,103 * "showMemberList": false,104 * "welcomeMemberPostEnabled": true105 * }106 * "lastActivityDate": "Mon Feb 04 2019 01:19:53 GMT+0300",107 * "_createdDate": "Mon Feb 04 2019 01:19:53 GMT+0300",108 * "_updatedDate": "Mon Feb 04 2019 01:19:53 GMT+0300",109 * "owner": "abe5e4e1-d950-4c46-8884-e7f231600d67"110 * }111 * }112 * ],113 * metadata: {114 * "count": 3,115 * "offset": 0,116 * "tooManyToCount": false,117 * "total": 3118 * }119 * }120 */