> 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 # GetActivityCounters # Package: activity # Namespace: ActivityCounters # Method link: https://dev.wix.com/docs/api-reference/crm/members-contacts/members/activity/activity-counters/get-activity-counters.md ## Permission Scopes: Read Activity Counters: SCOPE.DC-MEMBERS.READ-ACTIVITY-COUNTERS ## Introduction Retrieves activity counters for the specified site member, including all public counters and any private counters owned by the authenticated caller. > **Note**: Make sure to pass a `memberId` and not a `contactId` to identify the member. Any relationship between a member's `memberId` and `contactId` is coincidental. --- ## REST API ### Schema ``` Method: getActivityCounters Description: Retrieves activity counters for the specified site member, including all public counters and any private counters owned by the authenticated caller. > **Note**: Make sure to pass a `memberId` and not a `contactId` to identify the member. Any relationship between a member's `memberId` and `contactId` is coincidental. URL: https://www.wixapis.com/members/v1/activity-counters/{memberId} Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: memberId Method parameters: param name: memberId | type: none | required: true Return type: GetActivityCountersResponse - name: activityCounters | type: array | description: Activity counters. - name: memberId | type: string | description: Member GUID. - name: appId | type: string | description: App GUID. When developing websites, if you set activity counter data using elevation, the action is assigned to the generic Wix code backend app: `151e476a-715e-ec33-db9a-a7ff4d51f70a`. - name: counters | type: array | description: Counters for this member. - name: key | type: string | description: Counter key, unique within the given app. - name: public | type: boolean | description: Whether this counter data is available to all. If `false`, the counter is only available to the data owner and counter owner. - name: count | type: integer | description: Activity count. - name: revision | type: string | description: Revision number, which increments by 1 each time the counter is updated. To prevent conflicting changes, the existing revision must be used when updating a counter. ``` ### Examples ### Get Activity Counters ```curl curl -X GET \ https://www.wixapis.com/members/v1/activity-counters/987110f7-5100-4beb-a948-de610fd18f00 \ -H 'Authorization: ' \ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.activity.ActivityCounters.getActivityCounters(memberId) Description: Retrieves activity counters for the specified site member, including all public counters and any private counters owned by the authenticated caller. > **Note**: Make sure to pass a `memberId` and not a `contactId` to identify the member. Any relationship between a member's `memberId` and `contactId` is coincidental. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: memberId Method parameters: param name: memberId | type: string | description: Member GUID whose counters will be returned. | required: true Return type: PROMISE - name: activityCounters | type: array | description: Activity counters. - name: memberId | type: string | description: Member GUID. - name: appId | type: string | description: App GUID. When developing websites, if you set activity counter data using elevation, the action is assigned to the generic Wix code backend app: `151e476a-715e-ec33-db9a-a7ff4d51f70a`. - name: counters | type: array | description: Counters for this member. - name: key | type: string | description: Counter key, unique within the given app. - name: public | type: boolean | description: Whether this counter data is available to all. If `false`, the counter is only available to the data owner and counter owner. - name: count | type: integer | description: Activity count. - name: revision | type: string | description: Revision number, which increments by 1 each time the counter is updated. To prevent conflicting changes, the existing revision must be used when updating a counter. ``` ### Examples ### getActivityCounters ```javascript import { activityCounters } from '@wix/activity-counters'; async function getActivityCounters(memberId) { const response = await activityCounters.getActivityCounters(memberId); }; ``` ### getActivityCounters (with elevated permissions) ```javascript import { activityCounters } from '@wix/activity-counters'; import { auth } from '@wix/essentials'; async function myGetActivityCountersMethod(memberId) { const elevatedGetActivityCounters = auth.elevate(activityCounters.getActivityCounters); const response = await elevatedGetActivityCounters(memberId); } ``` ### getActivityCounters (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 { activityCounters } from '@wix/activity-counters'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { activityCounters }, // Include the auth strategy and host as relevant }); async function getActivityCounters(memberId) { const response = await myWixClient.activityCounters.getActivityCounters(memberId); }; ``` ---