All Collections
Dialogflow Chatbot Tutorial
Advance Chatbot Development
How to handle Media as a User Response in Dialogflow
How to handle Media as a User Response in Dialogflow

Guide on how to capture a User's Media Response in Google Dialogflow

Shivam Aggarwal avatar
Written by Shivam Aggarwal
Updated over a week ago

Users can send two types of media as messages -

  1. Only Media file

  2. Media file with a text

For the first case where the user only sends a Media File, Dialogflow receives the URL of the sent media.

For the case where the user sends Media File along with a text, the URL of the sent media is sent by adding it along with the text.

To handle URLs as user queries in Dialogflow, use RegExp (Regular Expression) type entity to capture such queries.

Example Regular Expression Entities




Use this to match any url received from user.


Use this to match url of specific domain.

e.g. -


This will only match with URL with "fb" as a domain name. e.g. -

RegExp to match URL of media sent by end-user



Use this to capture a 10-Digit number sent by the end-user

e.g. - Capture 10 digit mobile number only

How to set up RegExp type Entity in Google Dialogflow

  1. Go to Entities & click on Create Entity

2. Give a name to your entity & check the RegExp Entity

3. Add your RegExp & click on Save

4. Next create an intent to set up the training phrase, Parameter to capture the Media URL sent by the end-user & Chatbot Response. Once done with the setup, click on Save.

5. You can verify your setup from the Console

6. As you can see we have captured the URL sent by the user in Dialogflow Parameter. You can link this with User Attributes (AiSensy Dashboard) to store it in your AiSensy Contacts Dashboard.

Did this answer your question?