> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# ListMemberBlocks

# Package: membersV2

# Namespace: MemberToMemberBlocks

# Method link: https://dev.wix.com/docs/api-reference/crm/members-contacts/members/members-v2/member-to-member-block-v1/list-member-blocks.md

## Permission Scopes:
Read Members: SCOPE.DC-MEMBERS.READ-MEMBERS

## Introduction

Retrieves a list of up to 100 blocks involving the specified member, in both directions, sorted by the date the block was created in ascending order.

Each item in the list includes the ID of the other member and `blockDirection`, which indicates who blocked whom.

---

## REST API

### Schema

```
 Method: listMemberBlocks
 Description: Retrieves a list of up to 100 blocks involving the specified member, in both directions, sorted by the date the block was created in ascending order.  Each item in the list includes the GUID of the other member and `blockDirection`, which indicates who blocked whom.
 URL: https://www.wixapis.com/members/v1/member-to-member-blocks/members/{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: cursorPaging | type: CursorPaging    
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
   param name: memberId | type:   none | required: true 
 Return type: ListMemberBlocksResponse
  - name: memberBlocks | type: array<MemberBlock> | description: Blocks involving the specified member.  
     - name: memberId | type: string | description: GUID of the other member involved in the block.  | validation: format GUID
     - name: blockDirection | type: BlockDirection | description: Whether the member with `memberId` blocked the specified member, or was blocked by them.  
         - enum:
         -     UNKNOWN: Unknown block direction.
         -     BLOCKING: The member with `memberId` blocked the specified member.
         -     BLOCKED: The specified member blocked the member with `memberId`.
  - name: pagingMetadata | type: PagingMetadataV2 | description: Metadata for the paginated results.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000


```

### Examples

### List all blocks involving a member
Retrieves blocks in both directions. BLOCKED means the specified member blocked memberId; BLOCKING means memberId blocked the specified member.

```curl
curl -X GET \
'https://www.wixapis.com/members/v1/member-to-member-blocks/members/cdd1993d-811e-453d-8a0e-b9e0f7780b96?cursorPaging.limit=10' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.members.memberToMemberBlock.listMemberBlocks(memberId, options)
 Description: Retrieves a list of up to 100 blocks involving the specified member, in both directions, sorted by the date the block was created in ascending order.  Each item in the list includes the GUID of the other member and `blockDirection`, which indicates who blocked whom.
 # 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: GUID of the member whose blocks to retrieve. | required: true | validation: format GUID
   param name: options | type: ListMemberBlocksOptions  none  
        - name: cursorPaging | type: CursorPaging | description: Cursor paging options.  
           - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
           - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
 Return type: PROMISE<ListMemberBlocksResponse>
  - name: memberBlocks | type: array<MemberBlock> | description: Blocks involving the specified member.  
     - name: memberId | type: string | description: GUID of the other member involved in the block.  | validation: format GUID
     - name: blockDirection | type: BlockDirection | description: Whether the member with `memberId` blocked the specified member, or was blocked by them.  
         - enum:
         -     UNKNOWN: Unknown block direction.
         -     BLOCKING: The member with `memberId` blocked the specified member.
         -     BLOCKED: The specified member blocked the member with `memberId`.
  - name: pagingMetadata | type: PagingMetadataV2 | description: Metadata for the paginated results.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000


```

### Examples

### List all blocks involving a member
```javascript
import { memberToMemberBlock } from "@wix/members";

async function listMemberBlocks() {
  const response = await memberToMemberBlock.listMemberBlocks(
    "cdd1993d-811e-453d-8a0e-b9e0f7780b96",
    { cursorPaging: { limit: 10 } },
  );
}

/* Promise resolves to:
 * {
 *   "memberBlocks": [
 *     {
 *       "memberId": "e411fe13-9794-42b6-ad62-72c9917f1bac",
 *       "blockDirection": "BLOCKED"
 *     },
 *     {
 *       "memberId": "4b7e50fb-ee4a-41fd-97b3-34de43c3c506",
 *       "blockDirection": "BLOCKING"
 *     }
 *   ],
 *   "pagingMetadata": {
 *     "count": 2,
 *     "total": 2,
 *     "cursors": {}
 *   }
 * }
 */

```

### listMemberBlocks (self-managed)
Self-managed 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 { memberToMemberBlock } from '@wix/members';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { memberToMemberBlock },
  // Include the auth strategy and host as relevant
});


async function listMemberBlocks(memberId,options) {
  const response = await myWixClient.memberToMemberBlock.listMemberBlocks(memberId,options);
};
```

---