Obtain only sections with a defined relation
curl https://mburger.cloud/api/blocks/<id>/sections?filter[relation]=<block_id>,<section_id>
-H "Accept: application/json"
-H "X-MBurger-Token: <token>"
-H "X-MBurger-Version: 3"
let filterParameter = MBFilterParameter(field: "relation",
value: RELATION_BLOCK_ID + "," + RELATION_SECTION_ID)
MBClient.getSections(ofBlock: BLOCK_ID,
parameters: [filterParameter],
success: { (sections, paginationInfo) in
},
failure: { error in
})
val arrayFilters = ArrayList<Any>()
filters.add(MBFilterParameter(key = "relation",
value = RELATION_BLOCK_ID + "," + RELATION_SECTION_ID))
val sectionsListener = object: MBSectionsResultListener{
override fun onSectionsApiError(error: String) {
}
override fun onSectionsApiResult(sections: ArrayList<MBSection>,
block_id: Long,
paginationInfos: MBPaginationInfo) {
}
}
MBurgerTasks.askForSections(context = applicationContext,
block_id = BLOCK_ID,
filters = arrayFilters,
getElements = true,
listener = sectionsListener)
$response = (new MBurger())->getSections($block_id)->filterByRelation(int $block_id, int $section_id);
const mburger = require('mburger');
const instance = mburger.createClient({
api_key: "12578sdfghjkl",
});
instance.getBlock({
block_id: 884,
filter: {
'relation': 'block_id,section_id'
}
}).then(result => console.log(result));
MBFilterParameter filterParameter = MBFilterParameter(
field: 'relation',
value: RELATION_BLOCK_ID + ',' + RELATION_SECTION_ID,
);
MBPaginatedResponse<MBSection> sections =
await MBManager.shared.getSections(
blockId: BLOCK_ID,
parameters: [filterParameter],
);
Last updated