# Service.Fold.getFoldStateMap
Get the collapse information of the block of the entire doc , this method is called asynchronously.

## Availability description

Permission requirements | View Available Description | Platform is available | scene
---|---|---|---
Readable | All views | - PC<br>- Mobile | Presentation mode

## Input

| **Name** | **Data type**                                                               | **Is required** | **Description**         |
| -------- | --------------------------------------------------------------------------- | --------------- | ----------------------- |
| docRef   | [DocumentRef](https://open.feishu.cn/document/uAjLw4CM/uYjL24iN/docs-add-on/05-api-doc/basic-data-reference---base/DocumentRef) | Yes             | Specified doc reference |

## Output

Asynchronously returns a [FoldStateMap](https://open.feishu.cn/document/uAjLw4CM/uYjL24iN/docs-add-on/05-api-doc/FoldStateMap/foldstatemap)

## Example code

### Calling example

```js
const DocMiniApp = new BlockitClient().initAPI();
const documentRef = await DocMiniApp.getActiveDocumentRef();
const foldStateMap = await DocMiniApp.Service.Fold.getFoldStateMap(documentRef);
console.log('debug', foldStateMap);
```

### Return example

```json
{
    "2": {
        "show": true,
        "type": "isv",
        "id": 2
    },
    "3": {
        "id": 3,
        "type": "heading9",
        "show": true,
        "folded": true
    },
    "4": {
        "id": 4,
        "type": "text",
        "closestFolderId": 3,
        "foldedBy": 3,
        "foldedByType": "heading9",
        "show": false,
        "folded": false
    }
}
```