# Query the API for items

Create a basic UI with 3 views (**CiewControllers** for iOS and **activities** for Android) and a tab bar.&#x20;

Each view will represent a section of the app (**Home**, **News**, and **Gallery**).

To obtain the content that will be displayed in the views, call this function with the id of the block that you can see from the dashboard:

{% tabs %}
{% tab title="iOS" %}

```bash
MBClient.getSectionsWithBlockId(THE_BLOCK_ID, parameters: nil, success: { (sections, paginationInfos) in

}, failure: { (error) in
 
})
```

{% endtab %}

{% tab title="Android" %}

```bash
MBurgerTasks.askForSections(context, HOME_BLOCK_ID, null, true, listener)

...

@Override
public void onSectionsApiResult(ArrayList <MBSection> sections, long  block_id,
    MBPaginationInfo  paginationInfos)  {
    
    ArrayList <Home> homePages = new ArrayList <> ();        
    for (int i = 0; i < sections.size(); i++)  {          
        Home home = mapHome(sections.get(i));
        homePages.add(home);
    }      
    showHome();  
}    
```

{% endtab %}
{% endtabs %}

Now you need to create `Home` objects from `MBSection` objects in order to create an array of Homepages we will use the mapping functions of the section object to do this.


---

# 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/sample-app-1/query-the-api-for-items.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.
