# 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

})
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mburger.cloud/ios-docs/fetch-sections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
