I have DialogFlow sending a Fulfillment webhook to my server and I am able to send a text-to-speech response back to the google home device.
But how do I trigger a text-to-speech message to be read out by the device without having to initiate from the google home device?
I saw this question on SO which implies it's possible: Send audio file to DialogFlow using Python
I haven't been able to get his code to work because I don't know how to link the userId/sessionId that I get in my webhook call to the request.session_id
used in the example.
request = ai.text_request()
request.lang = 'de' # optional, default value equal 'en'
request.session_id = "<SESSION ID, UNIQUE FOR EACH USER>"
request.query = "Hello"
response = request.getresponse()
print (response.read())
I also found a CURL to trigger an event, but again I can't seem to link the sessionId in the url to my device.
curl -H "Authorization: Bearer YOUR_CLIENT_ACCESS_TOKEN"
"https://api.api.ai/v1/query?v=20150910&e=event_name&timezone=Europe/Paris
&lang=en&sessionId=1234567890"