I am looking for a way to say 'Thank you' and also make an API call at the end of function execution in Twilio.
Something like this:
responseObject = {
"actions": [
{
"say": "Thank you!"
},
{
"redirect": {
"uri": "API_LINK",
"method": "POST"
}
}
]
}
Sadly, twilio ignores every other message if you have a redirect. I tried to solve this by redirecting to TwiML first:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Thank you!</Say>
<Redirect method="POST">API_LINK</Redirect>
</Response>
But the above also does not work - It says application error after 'Thank you!' at the end. Also, I am passing query parameters along with API call: https://example.link?a=value&b=value. Not sure, how to pass that with TwiML.
This API request is supposed to send message to microsoft teams channel.