sendButtons on Meta Cloud API channel drops description and footer, no header/footer sent to WhatsApp
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 78/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
Direção de pesquisa
Comece em src/api/integrations/channel/meta/whatsapp.business.service.ts, em buttonMessage(), e depois acompanhe como sendMessageWithTyping() constrói a requisição para a Meta Graph API. Compare o caminho de botões com listMessage() e verifique se title, description e footer chegam aos campos esperados de header, body e footer interativos, enquanto o tratamento existente de botões permanece intacto.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the bug
On the Meta Cloud API channel (whatsapp.business.service.ts), POST /message/sendButtons/{instance} silently drops the description and footer fields. Only title is forwarded to WhatsApp — as the interactive message's body.text, with no header and no footer at all.
This means a request like:
{
"number": "[email protected]",
"title": "Titulo",
"description": "Hola, elige una opción",
"footer": "Mi empresa",
"buttons": [
{ "type": "reply", "displayText": "opcion a", "id": "reply_1" },
{ "type": "reply", "displayText": "opcion b", "id": "reply_2" }
]
}
is delivered to Meta with description and footer completely discarded, and only "Titulo" showing up on WhatsApp, with no body text and no footer below the buttons.
Root cause
In src/api/integrations/channel/meta/whatsapp.business.service.ts, buttonMessage():
public async buttonMessage(data: SendButtonsDto) {
const embeddedMedia: any = {};
const btnItems = {
text: data.buttons.map((btn) => btn.displayText),
ids: data.buttons.map((btn) => btn.id),
};
if (!arrayUnique(btnItems.text) || !arrayUnique(btnItems.ids)) {
throw new BadRequestException('Button texts cannot be repeated', 'Button IDs cannot be repeated.');
}
return await this.sendMessageWithTyping(
data.number,
{
text: !embeddedMedia?.mediaKey ? data.title : undefined, // only data.title is used
buttons: data.buttons.map((button) => {
return {
type: 'reply',
reply: {
title: button.displayText,
id: button.id,
},
};
}),
[embeddedMedia?.mediaKey]: embeddedMedia?.message,
},
{ ... },
);
}
data.description and data.footer are never read anywhere in this function. Then, in sendMessageWithTyping(), when building the actual Graph API request:
if (message['buttons']) {
content = {
messaging_product: 'whatsapp',
recipient_type: 'individual',
to: number.replace(/\D/g, ''),
type: 'interactive',
interactive: {
type: 'button',
body: {
text: message['text'] || 'Select', // this is data.title
},
action: {
buttons: message['buttons'],
},
// no header, no footer
},
};
...
}
No header and no footer key is ever added to interactive, even though Meta's Cloud API supports both for interactive.type = "button" messages.
For comparison, listMessage() in the same file maps all four fields correctly:
interactive: {
type: 'list',
header: { type: 'text', text: message['listMessage']['title'] },
body: { text: message['listMessage']['description'] },
footer: { text: message['listMessage']['footerText'] },
action: { button: message['listMessage']['buttonText'], sections: message['listMessage']['sections'] },
},
So sendList on this same channel works as documented — this is specifically a gap in the buttons path.
To Reproduce
- Configure an instance with
integration: WHATSAPP-BUSINESS(Meta Cloud API). - Call
POST /message/sendButtons/{instance}withtitle,description,footer, and 1-3replybuttons. - Observe on the recipient's WhatsApp: only the
titletext and the buttons are shown.descriptionandfooternever appear.
Expected behavior
description should populate interactive.body.text and title should populate interactive.header.text (matching how listMessage() handles the equivalent fields), and footer should populate interactive.footer.text, consistent with what Meta's Cloud API supports for interactive.type = "button" messages.
Environment
- Evolution API version:
2.3.7(confirmed present in this exact form in the2.3.7tag; also present on the current default branch) - Channel/integration:
WHATSAPP-BUSINESS(Meta Cloud API) - File:
src/api/integrations/channel/meta/whatsapp.business.service.ts, functionbuttonMessage()
- Linguagem predominante
- TypeScript
- Estrelas
- 9.7k
- Forks
- 7.3k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de evolution-foundation/evolution-api
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
evolution-foundation/evolution-api#2704 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
evolution-foundation/evolution-api#2702 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
evolution-foundation/evolution-api#2700 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
evolution-foundation/evolution-api#2675 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 76/100
evolution-foundation/evolution-api#2641 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de evolution-foundation/evolution-api
Issues semelhantes
-
Mend: dependency security vulnerability untriaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
opensearch-project/security-dashboards-plugin#2545 ·
Mantenedores costumam responder em até 1 dia
-
Add: Dream TR SDAbertacheck:passed streams:add
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
doctor integrity sample scans soft-deleted pages on Postgres (batch path has no deleted_at filter)Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
SocialGouv/egapro#4672 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
area:agents area:tui bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
anthropics/claude-code#98358 ·
Mantenedores costumam responder em até 1 dia