messagebird-nodejs icon indicating copy to clipboard operation
messagebird-nodejs copied to clipboard

Interactive message is not working whatsapp.

Open amithit opened this issue 3 years ago • 1 comments

const messagebird = require('messagebird')('<API_KEY>', null, [ 'ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX', ]);

      messagebird.conversations.reply(
        '<channel_id>',
        {
          type: 'interactive',
          content: {
                "interactive": {
                    "type": "list",
                    "header": {
                        "type": "text",
                        "text": "What you would like to do buy today?"
                    },
                    "body": {
                        "text": "To begin, tap Main Menu and choose from one of the following actions"
                    },
                    "action": {
                        "button": "Main Menu",
                        "sections": [
                            {
                                "title": "content-title-here",
                                "rows": [
                                    {
                                        "id": "unique-row-identifier-1",
                                        "title": "Buy bundles"
                                    }
                                ]
                            },
                            {
                                "title": "content-title-here",
                                "rows": [
                                    {
                                        "id": "unique-row-identifier-2",
                                        "title": "Buy airtime",
                                        "description": "optional description"
                                    }
                                ]
                            }
                        ]
                    }
                
            }
          },
        },
        function(err, response) {
          if (err) {
            return console.log(err);
          }
          console.log(response);
        },
      );

response

Error: api error(s): Internal server error (code: 99) at IncomingMessage. (/home/amit/messageGateway/bitbucket/new/channel-adapter/app/node_modules/messagebird/lib/messagebird.js:169:21) at IncomingMessage.emit (events.js:215:7) at endReadableNT (_stream_readable.js:1184:12) at processTicksAndRejections (internal/process/task_queues.js:80:21) { statusCode: 500, errors: [ { code: 99, description: 'Internal server error' } ] }

amithit avatar Oct 08 '21 11:10 amithit

Hi @amithit Are you trying to send interactive to WhatsAppSandbox channel? If yes - interactive messages are not supported for WhatsApp Sandbox. If not - did you try sending it with CURL? Does it work?

aodinok avatar Oct 09 '21 10:10 aodinok