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

Create Section

PreviousGet SectionNextUpdate Section

Last updated 4 years ago

Was this helpful?

How to create a new section.

Ensure to have read and write permissions.

You'll need to supply a list of parameters whose name matches the name of the section elements. For each element, you should give a value accordingly, or else the field would remain empty.

You can find a list of all available elements in the section!

This API accepts an arbitrary number of parameters.

An overview on how to send data is present at section.

You'll always need to supply the locale in the elements key, even if your project has the Multi-language feature disabled.

For example, if you wish to populate a section that has the following elements:

  • Title

  • Description

  • Image

  • Link

The list of parameters for a single locale (for example, Italian [it]) should be:

  • elements[it][title]

  • elements[it][description]

  • elements[it][image][0]

  • elements[it][link]

As you can see, every key of an element must be in the form of

As you can see, every key of a media element (image, audio, video, document, file) must be in the form of

Even if you add just a single image to a media element, it will always be considered as an array.

Instead relation elements doesn't require a locale so the key must be in the form of

This API assigns the section creator based on which auth headers are present. If the mobile auth header is present the creator is the mobile user, otherwise it will be assigned to project.

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

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 '<data>' 

URL Parameters

Name

Type

Required

Description

id

int

Yes

Block id

Parameters

The parameters to create a section will depend on which elements the section is made of and how many locales are present.

Name

Type

Required

Description

order

int

No

To specify an order

evidence

boolean

No

Enable in_evidence flag

elements

array

Yes

An Array of block's elements

If evidence is true, is possible to set other two parameters:

Name

Type

Required

Description

evidence_title

int

No

To specify an order

evidence_image

boolean

No

Enable in_evidence flag

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

{
  "status_code": 0,
  "body": {
    "id": 2,
    "order": 1,
    "all_locales": true,
    "visible": true,
    "in_evidence": false,
    "available_at": 1548343787,
    "updated_at": 1548343787
  }
}

elements[LOCALE][ELEMENT_NAME]

elements[LOCALE][ELEMENT_NAME][INDEX]

An overview on how to send media files is presented in the section.

relation[BLOCK_INDEX]

🔑
🔹
🔹
🔹
Available Data Types
Common
Multipart