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.
Request
Response
POST https://mburger.cloud/api/blocks/<id>/sections
1
curl https://mburger.cloud/api/blocks/<id>/sections
2
-X POST
3
-H "Accept: application/json"
4
-H "Content-Type: application/x-www-form-urlencoded"
5
-H "X-MBurger-Token: <token>"
6
-H "X-MBurger-Version: 3"
7
-d '<data>'
Copied!

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:
1
{
2
"status_code": 0,
3
"body": {
4
"id": 2,
5
"order": 1,
6
"all_locales": true,
7
"visible": true,
8
"in_evidence": false,
9
"available_at": 1548343787,
10
"updated_at": 1548343787
11
}
12
}
Copied!
Copy link