> 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/api-docs-1/sections/get-sections.md).

# Get Sections

{% hint style="info" %}
How to obtain project sections of a block.
{% endhint %}

{% tabs %}
{% tab title="Request" %}
`GET https://mburger.cloud/api/blocks/<id>/sections`

```bash
curl https://mburger.cloud/api/blocks/<id>/sections?include=elements&sort=-id&filter[value]=%home,news|paper&skip=0&take=2
-H "Accept: application/json" 
-H "X-MBurger-Token: <token>" 
-H "X-MBurger-Version: 3"
```

#### &#x20;URL Parameters

| Name | Type | Required | Description |
| ---- | ---- | -------- | ----------- |
| id   | int  | Yes      | Block id.   |

#### &#x20;Parameters

| Name                    | Type    | Required | Description                                                                                                                                                             |
| ----------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| skip                    | int     | Yes      | Specify the number of items to skip for pagination.                                                                                                                     |
| take                    | int     | Yes      | Specify the number of items to get for pagination.                                                                                                                      |
| locale                  | string  | No       | For multilanguage projects specify the desired locale for elements values. If locale is not provided or found the project fallback will be used.                        |
| force\_locale\_fallback | boolean | No       | If true and the requested locale is empty, the fallback locale is returned. Default false.                                                                              |
| include                 | string  | No       | Specify which relations to load and include in response.                                                                                                                |
| sort                    | string  | No       | Specify the sections order.                                                                                                                                             |
| filter                  | string  | No       | Specify filters on sections.                                                                                                                                            |
| image\_format           | string  | No       | Specify which image dimension to include in response. Values are *thumb*, *medium*, *large* and *original*. Default is *medium*.                                        |
| distance                | string  | No       | With this parameter and providing your latitude and longitude the distance between you and every section is added in the response. Example: distance=42.24234,13.543344 |

#### &#x20;Includes

| Name     | Description                                                        |
| -------- | ------------------------------------------------------------------ |
| elements | This relation will include all elements of each section.           |
| beacons  | This relation will include all beacons associated to each section. |

#### &#x20;Sort

| Name          | Default | Description                  |
| ------------- | ------- | ---------------------------- |
| id            | No      | Sort by id.                  |
| order         | No      | Sort by order field.         |
| available\_at | Yes     | Sort by available\_at field. |

#### &#x20;Filters

| Name         | Exact | Description                                                                                                                                                                                                                                                                    |
| ------------ | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| id           | Yes   | You can filter by id, or a list of comma-separated ids.                                                                                                                                                                                                                        |
| subscription | No    | You can filter sections based on Stripe subscription state. Values are *all*, *active*, *inactive*.                                                                                                                                                                            |
| relation     | No    | You can filter sections based on their relations.                                                                                                                                                                                                                              |
| value        | No    | You can filter only sections that have specific `value` in their elements. You can pass multiple parameters by passing a comma separated list of values. If you need to filter sections based only on a specific element you can use this syntax `element_name\|search_string` |
| geofence     | No    | You can filter only sections that have elements with a location inside a specific geofence. It requires a string of comma-separated coordinate values representing a rectangle of a map, composed as *NE latitude, SW latitude, NE longitude, SW longitude*.                   |
| {% endtab %} |       |                                                                                                                                                                                                                                                                                |

{% tab title="Response" %}
When successful, a HTTP 200 and JSON like this is returned:

```bash
{
  "status_code": 0,
  "body": {
    "meta": {
      "from": 0,
      "to": 2,
      "total": 10
    },
    "items": [
      {
        "id": 1,
        "order": 1,
        "all_locales": false,
        "visible": true,
        "in_evidence": false,
        "available_at": 1546599965,
        "updated_at": 1546599966,
        "elements": {
          "title": {
            "id": 2,
            "name": "title",
            "type": "text",
            "order": 1,
            "options": null,
            "locale": "en",
            "value": "Main Home"
          },
          "image": {
            "id": 3,
            "name": "image",
            "type": "image",
            "order": 2,
            "options": null,
            "locale": "en",
            "value": [
              {
                "id": 1,
                "url": "https://cdn.mburger.cloud/storage/1/conversions/image-medium.jpg",
                "size": 45166,
                "mime_type": "image/jpeg"
              }
            ]
          },
          "content": {
            "id": 4,
            "name": "content",
            "type": "textarea",
            "order": 3,
            "options": null,
            "locale": "en",
            "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec nisi et sapien tincidunt sodales."
          }
        }
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}
