sendButtons on Meta Cloud API channel drops description and footer, no header/footer sent to WhatsApp
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 78/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
Rechercherichtung
Beginne in src/api/integrations/channel/meta/whatsapp.business.service.ts bei buttonMessage() und verfolge anschließend, wie sendMessageWithTyping() die Anfrage an die Meta Graph API erstellt. Vergleiche den Pfad für Buttons mit listMessage() und überprüfe, dass title, description und footer die erwarteten Felder für interactive header, body und footer erreichen, während die bestehende Button-Behandlung intakt bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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()
- Vorherrschende Sprache
- TypeScript
- Sterne
- 9.7k
- Forks
- 7.3k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus evolution-foundation/evolution-api
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
evolution-foundation/evolution-api#2704 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
evolution-foundation/evolution-api#2702 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
evolution-foundation/evolution-api#2700 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
evolution-foundation/evolution-api#2675 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 76/100
evolution-foundation/evolution-api#2641 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in evolution-foundation/evolution-api
Ähnliche Issues
-
triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
mermaid-js/mermaid-live-editor#2053 ·
Maintainer antworten meist innerhalb von 1 Tag
-
factory
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
jessepollak/home#1455 ·
Maintainer antworten meist innerhalb von 1 Tag
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
lingdojo/kana-dojo#31227 · 1 Kommentar · 5 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
mobile: device viewer shows dark status bar icons on its dark backdrop in light mode (Android)Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
appandflow/stim#1838 ·
Maintainer antworten meist innerhalb von 1 Tag