2

Can I send additional data with the gather digits by twilio. I am trying to achieve is if someone sends a text saying HELP , we would call a support team and ask them that we have received the text message and if they want to talk to then press 1, and if they press 1 we will be able to call to the number from we have received the text message.

I was checking the twilio example and it sends the POST with the gather digits , can I post additional details , so a call will be made

<Response>
     <Gather numDigits="1" action="callback.php" method="POST">//I would like to send phone number to be called in this post request
        <Say>We have received a text for help ,to speak with the person  press 1. </Say>
    </Gather>
</Response> 
Stacy Thompson
  • 688
  • 1
  • 10
  • 26

1 Answers1

2

Twilio evangelist here.

You can pass more data as querystring parameters in the action url:

<Response>
    <Gather numDigits="1" action="callback.php?phone=15555555555" method="POST">
        <Say>We have received a text for help ,to speak with the person  press 1.</Say>
    </Gather>
</Response> 

Hope that helps.

Devin Rader
  • 10,260
  • 1
  • 20
  • 32
  • Just an FYI that if you need to pass more than one parameter, be sure to use `&` instead of `&` or will get an application error. – adrian Mar 23 '22 at 02:48