> 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 # Package: groups # Namespace: createGroupRequests # Webhook link: https://dev.wix.com/docs/api-reference/crm/community/groups/create-group-requests/group-request-approved.md ## Introduction Triggered when a group request is approved. --- ## REST API ### Schema ``` Webhook: Group Request Approved Description: Triggered when a group request is approved. Event body: - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events. - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event. - name: slug | type: string | description: Event name. - name: entityId | type: string | description: ID of the entity associated with the event. - name: eventTime | type: string (date-time) | description: Event timestamp. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR. - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: actionEvent | type: object | description: Custom action event details. - name: body | type: GroupRequestApproved | description: The event body. - name: groupRequest | type: GroupRequest | description: Approved group request. - name: id | type: string | description: Group request GUID. - name: group | type: Group | description: Group requested for creation. - name: id | type: string | description: Group GUID. - name: slug | type: string | description: A unique part of a group's URL, for example `https:/example.com/groups/slug`. - name: privacyStatus | type: PrivacyStatus | description: Group privacy status. - enum: - UNKNOWN: Undefined group privacy status. - PUBLIC: Anyone can see the group and its content. Anyone can join the group. - PRIVATE: Anyone can see the group, but only members can see its content. New members must submit a `Join Group Request`. - SECRET: Only admins and members can see the group. New members can only be added by other members. - name: name | type: string | description: Group name. - name: description | type: string | description: Group description in [DraftJS](https://draftjs.org) format. - name: teaser | type: string | description: Group teaser. - name: memberTitle | type: string | description: What group members are called, for example `Coworkers`, `Friends`, or `Students`. - name: coverImage | type: CoverImage | description: Cover image. You cannot upload your own cover image. - name: image | type: Image | description: Cover image. - name: mediaId | type: string | description: Image GUID (for internal use). - name: width | type: integer | description: Image width. - name: height | type: integer | description: Image height. - name: preset | type: boolean | description: Indicates pre-configured/auto-generated images (from templates, client generated). - name: position | type: Position | description: Position of the corner of the cover image (or logo). - name: x | type: float | description: horizontal coordinate - name: y | type: float | description: vertical coordinate - name: mobilePosition | type: Position | description: Position of the corner of the cover image (or logo) for mobile browser. - name: altText | type: string | description: Alternative text is typically a relatively short phrase that describes what the image depicts. The alternative text is used: + If the browser cannot display the image. + If the user is utilizing a screen reader. + By search engines to understand what images are on your site. - name: settings | type: GroupSettings | description: Group specific settings. These settings can also be found in [a site's Dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fwix-groups/settings?). - name: welcomeMemberPostEnabled | type: boolean | description: Whether a daily post about new members is enabled. - name: groupDetailsChangedPostEnabled | type: boolean | description: Whether an automatic post about changing the group details is enabled. - name: showMemberList | type: boolean | description: Whether all members can see the full member list. - name: allowedToInviteMembers | type: AllowPolicy | description: Determines who can invite members to the group - enum: UNKNOWN, OWNER_AND_ADMINS, OWNER, ALL_MEMBERS - name: allowedToApproveJoinRequests | type: AllowPolicy | description: Determines who can approve member join requests to the group - enum: UNKNOWN, OWNER_AND_ADMINS, OWNER, ALL_MEMBERS - name: aiSpamProtectionEnabled | type: boolean | description: Whether AI spam protection is enabled for post creation in the group. If not explicitly set, the default behavior is 'true' (enabled). - name: membersCount | type: integer | description: Total count of current group members. - name: ownerId | type: string | description: Group owner. - name: createdDate | type: string | description: Group creation date and time. - name: updatedDate | type: string | description: Date and time of the latest group update. - name: lastActivityDate | type: string | description: Date and time of the most recent group activity, for example a post or comment. - name: status | type: RequestStatus | description: Status of group request. - enum: - PENDING: Pending group request. - APPROVED: Approved group request. - REJECTED: Rejected group request. - CANCELED: Canceled group request. - name: requestDetails | type: RequestDetails | description: Group request details. - name: rejectionReason | type: string | description: Reason the request has been rejected. ``` ### Examples ```curl { "id": "7df3de0d-146b-4569-8891-b3920386ba2e", "entityFqdn": "wix.social_groups.v2.group_request", "slug": "approved", "entityId": "9893dfdc-a800-45dc-9595-dee6c418e035", "actionEvent": { "body": { "groupRequest": { "id": "9893dfdc-a800-45dc-9595-dee6c418e035", "group": { "id": "9893dfdc-a800-45dc-9595-dee6c418e035", "slug": "roblox-community", "privacyLevel": "PUBLIC", "title": "Roblox Community", "description": "Welcome to the group! You can connect with other members, get updates and share videos.", "details": { "logo": { "mediaId": "47be17_98a29afdc5934fd284e247bb4989b133~mv2.png", "width": 200, "height": 200 } }, "settings": { "membersPermittedToInvite": true, "membersPermittedToApprove": false, "memberWelcomePostEnabled": true, "groupDetailsChangedPostEnabled": true }, "membersCount": 1, "createdBy": { "id": "d0a2ef39-d8fd-449d-9db2-7f8d015656d9", "identityType": "MEMBER" }, "createdDate": "2021-02-15T10:06:30Z", "updatedDate": "2021-02-15T10:07:27Z", "recentActivityDate": "2021-02-15T10:06:30Z" } } } }, "eventTime": "2021-02-15T10:12:34.521618Z", "triggeredByAnonymizeRequest": false } ``` --- ## JavaScript SDK ### Schema ``` Webhook: onGroupRequestApproved Description: Triggered when a group request is approved. Payload: GroupRequestApprovedEnvelope - name: data | type: GroupRequestApproved | description: none - name: groupRequest | type: GroupRequest | description: Approved group request. - name: _id | type: string | description: Group request GUID. - name: group | type: Group | description: Group requested for creation. - name: _id | type: string | description: Group GUID. - name: slug | type: string | description: A unique part of a group's URL, for example `https:/example.com/groups/slug`. - name: privacyStatus | type: PrivacyStatus | description: Group privacy status. - enum: - UNKNOWN: Undefined group privacy status. - PUBLIC: Anyone can see the group and its content. Anyone can join the group. - PRIVATE: Anyone can see the group, but only members can see its content. New members must submit a `Join Group Request`. - SECRET: Only admins and members can see the group. New members can only be added by other members. - name: name | type: string | description: Group name. - name: description | type: string | description: Group description in [DraftJS](https://draftjs.org) format. - name: teaser | type: string | description: Group teaser. - name: memberTitle | type: string | description: What group members are called, for example `Coworkers`, `Friends`, or `Students`. - name: coverImage | type: CoverImage | description: Cover image. You cannot upload your own cover image. - name: image | type: Image | description: Cover image. - name: mediaId | type: string | description: Image GUID (for internal use). - name: width | type: integer | description: Image width. - name: height | type: integer | description: Image height. - name: preset | type: boolean | description: Indicates pre-configured/auto-generated images (from templates, client generated). - name: position | type: Position | description: Position of the corner of the cover image (or logo). - name: x | type: float | description: horizontal coordinate - name: y | type: float | description: vertical coordinate - name: mobilePosition | type: Position | description: Position of the corner of the cover image (or logo) for mobile browser. - name: altText | type: string | description: Alternative text is typically a relatively short phrase that describes what the image depicts. The alternative text is used: + If the browser cannot display the image. + If the user is utilizing a screen reader. + By search engines to understand what images are on your site. - name: settings | type: GroupSettings | description: Group specific settings. These settings can also be found in [a site's Dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fwix-groups/settings?). - name: welcomeMemberPostEnabled | type: boolean | description: Whether a daily post about new members is enabled. - name: groupDetailsChangedPostEnabled | type: boolean | description: Whether an automatic post about changing the group details is enabled. - name: showMemberList | type: boolean | description: Whether all members can see the full member list. - name: allowedToInviteMembers | type: AllowPolicy | description: Determines who can invite members to the group - enum: UNKNOWN, OWNER_AND_ADMINS, OWNER, ALL_MEMBERS - name: allowedToApproveJoinRequests | type: AllowPolicy | description: Determines who can approve member join requests to the group - enum: UNKNOWN, OWNER_AND_ADMINS, OWNER, ALL_MEMBERS - name: aiSpamProtectionEnabled | type: boolean | description: Whether AI spam protection is enabled for post creation in the group. If not explicitly set, the default behavior is 'true' (enabled). - name: membersCount | type: integer | description: Total count of current group members. - name: ownerId | type: string | description: Group owner. - name: _createdDate | type: Date | description: Group creation date and time. - name: _updatedDate | type: Date | description: Date and time of the latest group update. - name: lastActivityDate | type: Date | description: Date and time of the most recent group activity, for example a post or comment. - name: status | type: RequestStatus | description: Status of group request. - enum: - PENDING: Pending group request. - APPROVED: Approved group request. - REJECTED: Rejected group request. - CANCELED: Canceled group request. - name: requestDetails | type: RequestDetails | description: Group request details. - name: rejectionReason | type: string | description: Reason the request has been rejected. - name: metadata | type: EventMetadata | description: none - name: instanceId | type: string | description: App instance GUID. - name: eventType | type: string | description: Event type. - name: identity | type: IdentificationData | description: The identification type and identity data. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: identityType | type: WebhookIdentityType | description: - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP - name: accountInfo | type: AccountInfo | description: Details related to the account - name: accountId | type: string | description: GUID of the Wix account associated with the event. - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account. - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site. - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them. - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. - name: entityId | type: string | description: GUID of the entity associated with the event. - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR). - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. ``` ### Examples ```javascript import { groupRequests } from '@wix/groups'; groupRequests.onGroupRequestApproved((event) => { // handle your event here }); ``` ```javascript import { createClient, AppStrategy } from '@wix/sdk'; import { groupRequests } from '@wix/groups'; const wixClient = createClient({ auth: AppStrategy({ appId: 'MY-APP-ID', publicKey: 'YOUR_APP_PUBLIC_KEY', }), modules: { groupRequests, }, }); wixClient.groupRequests.onGroupRequestApproved((event) => { // handle your event here }); ``` ---