MBurger Headless CMS
User GuideCMS HeadlessEngagement Platform
  • 🍔MBurger Documentation🍔
  • 🔑 API
    • Introduction
      • Getting Started
      • Structure
    • Common Path
      • Basics
      • POST Bodies
      • POST Relations
      • Evaluating Responses
    • API Authentication
    • Project
    • Blocks
      • Get Blocks
      • Get Block
    • Sections
      • Get Sections
      • Get Section
      • Create Section
      • Update Section
      • Delete Section
    • Media
      • Get All Media
      • Upload Media
      • Get Media
      • Delete Media
    • Integrations / Extensions
      • Authentication Provider
        • Registration
        • Login
        • Logout
        • Get Profile
        • Update Profile
        • Delete Profile
        • Change Password
        • Forgot Password
      • Live Messages
        • Get All Live Messages
        • Send Live Message
        • Delete Live Message
      • In-App Subscriptions
        • InApp Subscription
        • Resume InApp Subscription
      • Shopify
        • Create a Shopify private app
        • Enable Shopify in MBurger
        • Collections Editor
      • Stripe
        • Create Customer
        • Get Cards
        • Create Card
        • Make Default
        • Delete Card
        • Subscription
        • Cancel Subscription
        • Resume Subscription
        • Payment
    • Going Deeper
      • Available Data Types (Elements)
  • 📱 Android SDK
    • Introduction
    • Installation
    • Initialization
    • Fetch for blocks
    • Fetch sections from blocks
    • Mapping to custom objects
    • Admin
      • Delete a Section/Media
      • Create a new Section
      • Update an existing Section
    • Auth
      • Register a new user
      • Authenticate a user
      • User profile
      • Edit profile
      • Other features
    • Proguard Rules
    • Plugins
    • Sample Apps
      • MBurger Explorer
      • MBurger Radio
    • MBurger Apps
  • 🍏 iOS SDK
    • Introduction
    • Installation
    • Initialization
    • Fetch the project
    • Fetch blocks
    • Fetch sections
    • Media
    • Encoding & Decoding
    • Serialization & Equality
    • Admin
      • Add/Edit a section
      • Delete a section
      • Upload media
      • Delete a media
    • Auth
      • Register a user
      • Authenticate a user
      • Retrieve user information
      • Update user profile
    • Plugins
    • Sample Apps
      • MBurger Explorer
      • MBurger Radio
    • MBurger Apps
  • 💻 PHP SDK
    • Installation & Configuration
    • How to use
    • Support & Feedback
    • License
  • ☕ JavaScript SDK
    • Introduction
    • Installation
    • Configuration
    • Methods Reference
    • Support & Feedback
    • License
  • 🔷Flutter SDK
    • Installation
    • Initialization
    • Fetch the project
    • Fetch blocks
    • Fetch sections
    • Media
    • Admin
      • Add/Edit a section
      • Delete a section
      • Upload a media
      • Delete a media
    • Auth
      • Register a user
      • Authenticate a user
      • Retrieve user information
      • Update user profile
  • ❓How to?
    • Basic interactions
      • Blocks
        • Get a Single Block
        • Get multiple Blocks
      • Sections
        • Get a single Section
        • Get Multiple Sections
        • Create a Section
        • Update a Section
        • Delete a Section
    • Advanced section retrieval
      • Filter sections
      • Obtain distance from a section
      • Manage locales and the fallback language
      • Get a section by SLUG
      • Obtain only sections with a defined relation
    • Advanced section creation
      • Create a section with a relation
      • Set the value of a checkbox element
      • Create a section with a multiple or dropdown element
      • Create a section with a SLUG
      • Create a section with SEO
      • Send or schedule a push when creating a section
    • Set the visibility of a section
    • Get images with various format
  • 👻 Sample App
    • Introduction
    • Create an MBurger project
    • Create Home, News and Gallery blocks
    • Create the project
    • Setup the SDK
    • Query the API for items
    • Map your objects from MBurger objects
    • Implement push notifications
    • Take a bite
Powered by GitBook
On this page

Was this helpful?

  1. API
  2. Sections

Get Sections

How to obtain project sections of a block.

GET https://mburger.cloud/api/blocks/<id>/sections

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"

URL Parameters

Name

Type

Required

Description

id

int

Yes

Block id.

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

Includes

Name

Description

elements

This relation will include all elements of each section.

beacons

This relation will include all beacons associated to each section.

Sort

Name

Default

Description

id

No

Sort by id.

order

No

Sort by order field.

available_at

Yes

Sort by available_at field.

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.

When successful, a HTTP 200 and JSON like this is returned:

{
  "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."
          }
        }
      }
    ]
  }
}

PreviousSectionsNextGet Section

Last updated 4 years ago

Was this helpful?

🔑