> 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 # CountResourceTypes # Package: resources # Namespace: ResourceTypesService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/count-resource-types.md ## Permission Scopes: Read Bookings - Public Data: SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC ## Introduction Counts resource types, given the provided filtering. See [Query Resource Types](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/query-resource-types.md) for a list of supported filters. --- ## REST API ### Schema ``` Method: countResourceTypes Description: Counts resource types, given the provided filtering. See [Query Resource Types](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/query-resource-types.md) for a list of supported filters. URL: https://www.wixapis.com/bookings/v2/resources/resource-types/count Method: POST Method parameters: param name: filter | type: filter | description: Filter to base the count on. See [Query Resource Types](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/query-resource-types.md) for a list of supported filters. Return type: CountResourceTypesResponse - name: count | type: integer | description: Number of resource types matching the filter. ``` ### Examples ### Count resource types. ```curl curl -X POST \ 'https://www.wixapis.com/bookings/v2/resources/resource-types/count' \ -H 'Authorization: ' \ -d '{}' ``` ### Count resource types with a filter. Count resource types, providing a filter to count only the ones whose name starts with a specific value. ```curl curl -X POST \ 'https://www.wixapis.com/bookings/v2/resources/resource-types/count' \ -H 'Authorization: ' \ -d '{ "filter": { "name": { "$startsWith": "meeting" } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.resources.ResourceTypesService.countResourceTypes(options) Description: Counts resource types, given the provided filtering. See [Query Resource Types](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/query-resource-types.md) for a list of supported filters. Method parameters: param name: options | type: CountResourceTypesOptions none - name: filter | type: object | description: Filter to base the count on. See [Query Resource Types](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/query-resource-types.md) for a list of supported filters. Return type: PROMISE - name: count | type: integer | description: Number of resource types matching the filter. ``` ### Examples ### countResourceTypes ```javascript import { resourceTypes } from '@wix/bookings'; async function countResourceTypes(options) { const response = await resourceTypes.countResourceTypes(options); }; ``` ### countResourceTypes (with elevated permissions) ```javascript import { resourceTypes } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function myCountResourceTypesMethod(options) { const elevatedCountResourceTypes = auth.elevate(resourceTypes.countResourceTypes); const response = await elevatedCountResourceTypes(options); } ``` ### countResourceTypes (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 { resourceTypes } from '@wix/bookings'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { resourceTypes }, // Include the auth strategy and host as relevant }); async function countResourceTypes(options) { const response = await myWixClient.resourceTypes.countResourceTypes(options); }; ``` ---