GoogleCloudPlatform / dialogflow-integrations

Dialogflow integrations with multiple platforms including KIK, Skype, Spark, Twlio, Twitter and Viber
https://cloud.google.com/dialogflow/
Apache License 2.0
247 stars 499 forks source link

Problem with my Agent when Integrated with Twilio for WhatsApp #144

Open alawibh opened 2 years ago

alawibh commented 2 years ago

Hello Everyone,

Since one week I'm trying to integrate Dialogflow with Twilio for WhatsApp messaging.

The integration has been configured successfully, but I'm facing strange error when retrieving our products through HTTP request using Axios.

Test code is here:

function testLoopReply(agent) {
   const category_name = 'Small%20Appliances';  
   return new Promise((resolve, reject) => {
       axios.get(`https://sheetdb.io/api/v1/qvlk728a5p23g/search?Categories=*${category_name}*&Status=1&limit=1`).then(function (res) {
           let Categories = res.data;
           if (Categories) {                
                 for (const product of Categories ){
                    agent.add(`https://alaswadtrading.com/index.php?route=product/product&product_id=${product.ProductID}\n\n${product.Name}`);
                }
           } else {
                agent.add(`No items found in the selected category (${category_name})`);
           }

           resolve();
       });
   }); 
  }

Consider scenario No. 1:

In this scenario, the agent reply with those multiple results normally as per attached snapshot:

Test-With-Cooking

But Twilio does not respond and an error 11200 triggered as per attached snapshots:

Test-With-Cooking-Twilio

Test-With-Cooking-Twilio-Error-Message

Now, consider scenario No. 2

In this scenario, the agent reply with the results normally as per attached snapshot:

Test-With-Small

Also, Twilio worked fine and respond normally as per attached snapshot:

Test-With-Small-Twilio

I have contacted Dialogflow and Twilio but with no luck to find a solutions, and here their reply:

Twilio-Support-1

Twilio-Support-2

I'm not sure what is the problem and how I can figure it out in order to publish our agent.

Kindly, advice?

CRISTIANLOPEZ16 commented 2 years ago

hi, were you able to resolve the error?