Create Section

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 Available Data Types section!

This API accepts an arbitrary number of parameters.

An overview on how to send data is present at Common 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

πŸ”Ή elements[LOCALE][ELEMENT_NAME]

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

πŸ”Ήelements[LOCALE][ELEMENT_NAME][INDEX]

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

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

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

πŸ”Ήrelation[BLOCK_INDEX]

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

Last updated