Users can send two types of media as messages -
Only Media file
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.
This will only match with URL with "fb" as a domain name. e.g. - https://fb.com/page/2928
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
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.