0

I have a Dialogflow chatbot set up which is integrated with the Twilio WhatsApp API. It's all good when I type text on WhatsApp, but I receive this error on Twilio debugger when I post an image or a video on WhatsApp:

Error - 12300 Invalid Content-Type

Twilio is unable to process the Content-Type of the provided URL. Please see the Twilio Markup XML Documentation for more information on valid Content-Types. You must return a Content-Type for all requests. Requests without a Content-Type will appear in the Debugger as a 502 Bad Gateway error.

Possible Causes:

Having a phone number, outgoing call request or action attribute refer to a non-XML or audio resource. Having a Play verb attempt to play non-audio content, such as XML or text.

Possible Solutions:

Verify that that your web server is returning a Content-Type and it is the expected value Make sure the URL noted refers to a valid resource

I have checked it on both Dialogflow and Twilio consoles but I am not sure which configuration I have to set up for image uploading to work.

gogofan
  • 533
  • 1
  • 10
  • 20

2 Answers2

0

Currently media isn't supported with WhatsApps integration, so that would explain the issue.

Receiving a WhatsApp message

https://www.twilio.com/docs/sms/whatsapp/api#receiving-a-whatsapp-message

"Support for Inbound media and location is coming soon."

Alan
  • 10,465
  • 2
  • 8
  • 9
0

Twilio now accept media on WhatsApp messages, the "Body" parameter is empty and you can access media information in other request parameters:

{
  "MediaUrl0": "https://api.twilio.com/2021-04-01/Accounts/ABC...",
  "MediaContentType0": "image/jpeg",
  "NumMedia": "1",
  ...
}

This also maybe help: https://github.com/GoogleCloudPlatform/dialogflow-integrations/pull/18

Hevelson Rosario
  • 420
  • 6
  • 11