Methods Reference

3.1 - Initiate the connection

Init the connection to MBurger with your API Key.

const instance = mburger.createClient({
    api_key: '1234567890'
});

3.2 - Retrieve a single Section

3.2.1 - Sample code

 // Import MBurger SDK
 const mburger = require('mburger');
 
// Init the connection
const instance = mburger.createClient({
    api_key: '1234567890'
});

// Get a specific block
instance.getSection({
    section_id: 10088,
    locale: 'it',
    original_media: false
}).then(result => console.log(result));

3.3 - Retrieve a single Block

3.3.1 - Sample code

 // Import MBurger SDK
 const mburger = require('mburger');
 
// Init the connection
const instance = mburger.createClient({
    api_key: '1234567890'
});

// Retrieve a specific block
instance.getBlock({
    block_id: 884,
    locale: 'it',
    original_media: false
}).then(result => console.log(result));

3.4 - Retrieve multiple Blocks

3.4.1 - Sample code

// Import MBurger SDK
const mburger = require('mburger');

// Init the connection
const instance = mburger.createClient({
    api_key: '1234567890'
});

// Retrieve data from the block
instance.getBlocks({
    block_ids: [884, 886],
    locale: 'it'
}).then(result => console.log(result));

Last updated