> 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 # CountReviewRequests # Package: reviews # Namespace: ReviewRequestsV2 # Method link: https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/reviews/review-requests/count-review-requests.md ## Permission Scopes: Read Review Requests: SCOPE.DC_REVIEWS.READ-REVIEW_REQUESTS ## Introduction Retrieves the number of review requests that match a specified filter. If a filter isn't passed in the request, the method returns the count of all review requests. --- ## REST API ### Schema ``` Method: countReviewRequests Description: Retrieves the number of review requests that match a specified filter. If a filter isn't passed in the request, the method returns the count of all review requests. URL: https://www.wixapis.com/reviews/v2/review-requests/count Method: POST Method parameters: param name: filter | type: filter | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Return type: CountReviewRequestsResponse - name: count | type: integer | description: Number of review requests. Possible Errors: HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: TOO_MANY_TO_COUNT | Description: Number of review requests exceeds the server's limit. ``` ### Examples ### Count Review Requests ```curl curl -X POST \ 'https://www.wixapis.com/reviews/v2/review-requests/count' \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' \ -d '{ "filter": { "namespace": "stores" } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.reviews.ReviewRequestsV2.countReviewRequests(options) Description: Retrieves the number of review requests that match a specified filter. If a filter isn't passed in the request, the method returns the count of all review requests. Method parameters: param name: options | type: CountReviewRequestsOptions none - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Return type: PROMISE - name: count | type: integer | description: Number of review requests. Possible Errors: HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: TOO_MANY_TO_COUNT | Description: Number of review requests exceeds the server's limit. ``` ### Examples ### countReviewRequests ```javascript import { reviewRequests } from '@wix/reviews'; async function countReviewRequests(options) { const response = await reviewRequests.countReviewRequests(options); }; ``` ### countReviewRequests (with elevated permissions) ```javascript import { reviewRequests } from '@wix/reviews'; import { auth } from '@wix/essentials'; async function myCountReviewRequestsMethod(options) { const elevatedCountReviewRequests = auth.elevate(reviewRequests.countReviewRequests); const response = await elevatedCountReviewRequests(options); } ``` ### countReviewRequests (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 { reviewRequests } from '@wix/reviews'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { reviewRequests }, // Include the auth strategy and host as relevant }); async function countReviewRequests(options) { const response = await myWixClient.reviewRequests.countReviewRequests(options); }; ``` ---