Twilio accepts location and media sharing from a platform like WhatsApp. When this content comes in, the body.Body parameter is left empty and additional parameters are added for these content types. Dialogflow however, can't process an empty body content, hence the request fails.
For this purpose, if location is shared, we should pass geoLocation in the body parameter; if it's any other media type, we get the type from MediaContentType0 and pass that.
Then, on Dialogflow side, we process this information by providing training data that matches e.g. geolocation, image/jpeg, audio/mp3, application/pdf...etc. And we read additional information through the fulfillment in req.originalDetectIntentRequest.payload e.g. req.originalDetectIntentRequest.payload.MediaUrl0.
Twilio accepts location and media sharing from a platform like WhatsApp. When this content comes in, the
body.Body
parameter is left empty and additional parameters are added for these content types. Dialogflow however, can't process an empty body content, hence the request fails.For this purpose, if location is shared, we should pass
geoLocation
in thebody
parameter; if it's any other media type, we get the type fromMediaContentType0
and pass that.Then, on Dialogflow side, we process this information by providing training data that matches e.g. geolocation, image/jpeg, audio/mp3, application/pdf...etc. And we read additional information through the fulfillment in
req.originalDetectIntentRequest.payload
e.g.req.originalDetectIntentRequest.payload.MediaUrl0
.