# Create a Section

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

```bash
curl https://mburger.cloud/api/blocks/<id>/sections
-X POST 
-H "Accept: application/json" 
-H "Content-Type: application/x-www-form-urlencoded"
-H "X-MBurger-Token: <token>" 
-H "X-MBurger-Version: 3"
-d 'elements[<locale>][<element_type>]=<value>'
```

{% endtab %}

{% tab title="iOS SDK" %}

```swift
let elementsFactory = MBUploadableElementsFactory(localeIdentifier: "en")
    
let elements = [elementsFactory.createTextElement(name: TEXT_NAME, text: "text"),
                elementsFactory.createImageElement(name: IMAGE_NAME, image: image)]
        
MBAdmin.addSectionToBlock(withBlockId: BLOCK_ID,
                          elements: elements,
                          success: { sectionId in
                                    
                          },
                          failure: { error in
                                    
                          })
```

{% endtab %}

{% tab title="Android SDK" %}

```kotlin
val params = ArrayList<MBAdminGenericParameter>()
params.add(MBAdminParameter(TEXT_NAME, name))

val params_file = ArrayList<MBAdminParameterFile>()
val images = ArrayList<MBAdminSingleFile>()
images.add(MBAdminSingleFile(
                    getFileName(applicationContext, img_uri),
                    getMimeType(applicationContext, img_uri),
                    getPath(applicationContext, img_uri)))

params_file.add(MBAdminParameterFile(IMAGE_NAME, images));

val addSectionListener = object: MBAdminAddSectionListener{
            override fun onSectionAdded(section_id: Long) {
            }

            override fun onSectionAddedError(error: String) {
            }
        }

MBurgerAdminTasks.addSection(
                    context = applicationContext, 
                    block_id = BLOCK_ID, 
                    listener = addSectionListener, 
                    params = params,
                    parameters_files = params_file, 
                    locale = Locale.getDefault().getLanguage());

```

{% endtab %}

{% tab title="PHP SDK" %}

```
// Work in Progress
```

{% endtab %}

{% tab title="JS SDK" %}

```javascript
// POST actions are not available atm on our JS SDK.
// If it could be interesting for you, please submit 
// a feature request here:
// https://support.mburger.cloud/hc/en-us/community/topics/360000550497-Feature-Request?
```

{% endtab %}

{% tab title="Flutter SDK" %}

```dart
MBUploadableElementsFactory factory = MBUploadableElementsFactory('en');
List<MBUploadableElement> elements = [
    factory.createTextElement(ELMENT_NAME, 'text'),
];
await MBAdmin.shared.addSectionToBlock(BLOCK_ID, elements);
```

{% endtab %}
{% endtabs %}


---

# 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/how-to/basic-interactions/sections/create-a-section.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.
