microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.5k stars 2.44k forks source link

Messenger Chatbot error: Failed calling Send API 400 Bad Request { message: '(#100) Message cannot be empty #4546

Closed BardoUntiveros closed 6 years ago

BardoUntiveros commented 6 years ago

Bot Info

Issue Description

I'm using DialogFlow and Heroku to make a chatbot messenger. I have everything connected and deployed the server already.

I tried adding quick replies after the first message sent by the user.

After adding the code to do this, it won't appear. When I check "heroku logs", it appears this error:

"Failed calling Send API 400 Bad Request { message: '(#100) Message cannot be empty"

It says message cannot be empty, but I checked everything that could be empty, there is nothing empty, not in my code neither in DialogFlow. What can I do? I tried doing everything again and again and it won't work.

Code Example

----- THIS IS THE CODE TO ADD QUICK REPLIES ------

function handleApiAiAction(sender, action, responseText, contexts, parameters) { switch (action) { case "job-enquiry": let replies = [{ "content_type": "text", "title": "Accountant", "payload": "Accountant" }, { "content_type": "text", "title": "Sales assistant", "payload": "Sales assistant" }, { "content_type": "text", "title": "Not interested", "payload": "Not interested" }];

sendQuickReply(sender, responseText, replies)
break;
default:
   sendTextMessage(sender, respondeText);
}

};

----- THIS IS THE JSON ON DIALOGFLOW ------

{ "responseId": "ae2327b9-8f8a-4b51-b7dd-1b820f0249a8", "queryResult": { "queryText": "987654321", "action": "detailed-application", "parameters": { "previous-job": "Accountant", "years-of-experience": "2", "user-name": "Qwerty", "phone-number": "987654321" }, "allRequiredParamsPresent": true, "fulfillmentMessages": [ { "text": { "text": [ "Thank you Qwerty for you application. My boss will call you ASAP! Have a great day!" ] }, "platform": "FACEBOOK" } ], "outputContexts": [ { "name": "projects/botcontratos/agent/sessions/8d7463a1-dc4b-4344-a47c-68f044b52b54%3AdetectIntent/contexts/job_application", "lifespanCount": 4, "parameters": { "phone-number.original": "987654321", "previous-job.original": "Accountant", "job-vacancy": "Accountant", "phone-number": "987654321", "previous-job": "Accountant", "user-name.original": "Qwerty", "years-of-experience": "2", "job-vacancy.original": "accountant", "user-name": "Qwerty", "years-of-experience.original": "2" } }, { "name": "projects/botcontratos/agent/sessions/8d7463a1-dc4b-4344-a47c-68f044b52b54%3AdetectIntent/contexts/job", "lifespanCount": 3, "parameters": { "phone-number": "987654321", "previous-job": "Accountant", "user-name.original": "Qwerty", "years-of-experience": "2", "job-vacancy.original": "accountant", "user-name": "Qwerty", "years-of-experience.original": "2", "phone-number.original": "987654321", "previous-job.original": "Accountant", "job-vacancy": "Accountant" } } ], "intent": { "name": "projects/botcontratos/agent/intents/633008c5-9931-488e-8e0e-41ec5928face", "displayName": "job-application-details" }, "intentDetectionConfidence": 1, "diagnosticInfo": {}, "languageCode": "es" } }

Reproduction Steps

  1. User asks for job vacancy. Bot asks what position do you want
  2. User says position. Bot tells to type ok when ready
  3. User type ok and bot answer name, current position, years of experience and phone number (parameters). User answer each question.
  4. Bot says thanks. That's it

Expected Behavior

Make quick replies appear after bot asks what position do user want: (1) Accountant (2) Sales assistant

Actual Results

Quick replies won't appear. Also, heroku logs (on terminal) show this error:

Failed calling Send API 400 Bad Request { message: '(#100) Message cannot be empty, must provide valid attachment or text', type: 'OAuthException', code: 100, error_subcode: 2018034, fbtrace_id: 'A4AjKxBrXR9' }

JasonSowers commented 6 years ago

I'm not sure why you posted this here. For Dialog Flow issue contact Dialog flow support https://dialogflow.com/support/ We do not support dialog flow as it is not our product.