> 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 # ListAnswers # Package: memberManagement # Namespace: MembershipQuestionsService # Method link: https://dev.wix.com/docs/api-reference/crm/community/groups/member-management/membership-questions/list-answers.md ## Introduction Retrieves the answers to the membership questions, given the provided filters. >**Note:** >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions.md). --- ## REST API ### Schema ``` Method: listAnswers Description: Retrieves the answers to the membership questions, given the provided filters. >**Note:** >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions.md). URL: https://www.wixapis.com/v2/membership-questions/{groupId}/answers Method: POST Method parameters: param name: memberIds | type: array | description: Member GUIDs. If no member GUID is provided, answers for all members will be returned. See the Members API for more details. param name: paging | type: Paging - 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. Return type: ListAnswersResponse - name: memberAnswers | type: array | description: Answers to the membership questions, grouped by member. - name: memberId | type: string | description: Member GUID. See the Members API for more details. - name: answers | type: array | description: Answers to the membership question. - name: id | type: string | description: Question GUID. - name: text | type: string | description: Answer text. - name: questions | type: Map | description: Membership questions by question GUID. Includes only questions that have been answered by the specified members. - name: id | type: string | description: Question GUID. - name: required | type: boolean | description: Whether a member must answer this question when joining the group. - name: text | type: string | description: Question text. - 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 ### ListAnswers ```curl ~~~cURL curl -X GET \ https://wixapis.com/social-groups/v2/membership-questions/707c1e28-c111-46e1-bafa-4e97c8fa490f/answers \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' s { "memberAnswers": [ { "memberId": "92c2810b-40e0-4b3d-9a51-6b404fea9a00", "answers": [ { "id": "4527a3a6-804e-6f36-8aa3-2a73ca30da95", "text": "Test answer" } ] } ], "questions": { "4527a3a6-804e-6f36-8aa3-2a73ca30da95": { "id": "4527a3a6-804e-6f36-8aa3-2a73ca30da95", "required": true, "text": "Question 1" }, "8b1921a8-385c-31f5-0aa2-ee992b820f91": { "id": "8b1921a8-385c-31f5-0aa2-ee992b820f91", "required": false, "text": "Question 2" } } } ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.memberManagement.MembershipQuestionsService.listAnswers(groupId, options) Description: Retrieves the answers to the membership questions, given the provided filters. >**Note:** >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions.md). # 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: Group GUID. | required: true param name: options | type: ListAnswersOptions none - name: memberIds | type: array | description: Member GUIDs. If no member GUID is provided, answers for all members will be returned. See the Members API for more details. - name: paging | type: Paging | description: - 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. Return type: PROMISE - name: memberAnswers | type: array | description: Answers to the membership questions, grouped by member. - name: memberId | type: string | description: Member GUID. See the Members API for more details. - name: answers | type: array | description: Answers to the membership question. - name: _id | type: string | description: Question GUID. - name: text | type: string | description: Answer text. - name: questions | type: Map | description: Membership questions by question GUID. Includes only questions that have been answered by the specified members. - name: _id | type: string | description: Question GUID. - name: required | type: boolean | description: Whether a member must answer this question when joining the group. - name: text | type: string | description: Question text. - 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 ### listAnswers ```javascript import { membershipQuestions } from '@wix/groups'; async function listAnswers(groupId,options) { const response = await membershipQuestions.listAnswers(groupId,options); }; ``` ### listAnswers (with elevated permissions) ```javascript import { membershipQuestions } from '@wix/groups'; import { auth } from '@wix/essentials'; async function myListAnswersMethod(groupId,options) { const elevatedListAnswers = auth.elevate(membershipQuestions.listAnswers); const response = await elevatedListAnswers(groupId,options); } ``` ### listAnswers (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 { membershipQuestions } from '@wix/groups'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { membershipQuestions }, // Include the auth strategy and host as relevant }); async function listAnswers(groupId,options) { const response = await myWixClient.membershipQuestions.listAnswers(groupId,options); }; ``` ---