Closed marluanespiritusanto closed 1 year ago
@marluanespiritusanto, can you reference what docs you say you're looking at? The WhatsApp SDK docs state that you need to send the InteractiveObject as the argument to body for sending a button: https://whatsapp.github.io/WhatsApp-Nodejs-SDK/api-reference/messages/interactive
The object you pass in should be InteractiveObject, which should not have the parent "interactive" key.
@rashedtalukder I agree with you, the documentation does not indicate that an interactive
property is required, but if you check this line, you will see that it is.
export type InteractiveObject = {
[MessageTypesEnum.Interactive]:
| ButtonInteractiveObject
| ListInteractiveObject
| ProductInteractiveObject
| ProductListInteractiveObject;
};
Appreciate the follow up and you are right. I pushed a new branch that should remedy that issue. Let me know if it resolves your issue and I'll see about adding it to the main line: https://github.com/WhatsApp/WhatsApp-Nodejs-SDK/tree/hotfix/InteractiveObject
@rashedtalukder With your hotfix branch work like a charm. You can proceed with the PR.
Prerequisites
Please ensure the following are done before submitting an issue:
Expected behavior
Using the
interactive
method of themessages
object should send an interactive message (button or list).Current behavior
The method returns a 400 Bad Request because an unexpected property is sent:
interactive
.Failure information (for bug reporting)
If this is a bug, please complete the sections below. Otherwise, delete and enter your feature request here.
Steps to Reproduce
Detailed steps to reproduce the issue. Be as detailed as possible without compromising any sensitive data.
Context
Please provide any other relevant information about your application or configuration.
The request is supposed to be like this:
this is what is being sent instead:
The problem is here in this line.
Failure Logs
Please paste any relevant logs here. REMEMBER TO REMOVE ANY/ALL sensitive data (e.g. phone numbers, names, security keys, etc.)!!!