> For the complete documentation index, see [llms.txt](https://docs.mburger.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mburger.cloud/ios-docs/fetch-sections.md).

# Fetch sections

You can retrieve all the sections with a block with the given id with the function **`getBlocksWithParameters:Success:Failure`** like this:

```swift
MBClient.getSections(ofBlock: THE_BLOCK_ID, parameters: nil, success: { (sections, paginationInfo) in

}, failure: { error in

})
```

The **`parameters`** value is an array of **`MBParameter`** objects as described in the previous section.

For the blocks, there’s a version of this function that takes a bool **`includeElements`** that indicates whether or not the elements of the section.&#x20;

If you want to retrieve all the sections of a block and their elements you can call:

```swift
MBClient.getSections(ofBlock: THE_BLOCK_ID, parameters: nil, elements: true, success: { (sections, paginationInfo) in

}, failure: { error in

})
```
