Lista
function List(number, headerText, bodyText, footerText, buttonTittle, sections){
const data = JSON.stringify({
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": number,
"type": "interactive",
"interactive": {
"type": "list",
"header": {
"type": "text",
"text": headerText
},
"body": {
"text": bodyText
},
"footer": {
"text": footerText
},
"action": {
"button": buttonTittle,
"sections": sections.map(section => {
return {
title: section.title,
rows: section.rows.map(row => {
return {
id: row.id,
title: row.title,
description: row.description
};
})
};
})
}
}
});
return data;
}Última actualización