For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update a Section

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 'elements[<locale>][<element_type>]=<updated_value>'
let elementsFactory = MBUploadableElementsFactory(localeIdentifier: "en")
    
let elements = [elementsFactory.createTextElement(name: TEXT_NAME, text: "text"),
                elementsFactory.createImageElement(name: IMAGE_NAME, image: image)]
                     
MBAdmin.editSection(withSectionId: SECTION_ID,
                    elements: elements,
                    success: {
                                
                    },
                    failure: { error in
                                
                    })
val params = ArrayList<MBAdminGenericParameter>()
params.add(MBAdminParameter(TEXT_NAME, name))

val params_file = ArrayList<MBAdminParameterFile>()
val images = ArrayList<MBAdminSingleFile>()
images.add(MBAdminSingleFile(
                    getFileName(applicationContext, img_uri),
                    getMimeType(applicationContext, img_uri),
                    getPath(applicationContext, img_uri)))

params_file.add(MBAdminParameterFile(IMAGE_NAME, images));

val updateSectionListener = object: MBAdminUpdateSectionListener{
            override fun onSectionUpdated(section_id: Long) {
            }

            override fun onSectionUpdatedError(error: String) {
            }
        }

MBurgerAdminTasks.updateSection(
                    context = applicationContext, 
                    block_id = BLOCK_ID, 
                    listener = addSectionListener, 
                    params = params,
                    parameters_files = params_file, 
                    locale = Locale.getDefault().getLanguage(),
                    show_in_app = true);

Last updated