Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to pass a custom parameter when make a call with Twilio?

I'm using Twilio PHP library but the question is actually language agnostic. I tried to do something like following:

$client = new Services_Twilio('MyAccountSID', 'My auth token');
$client->account->calls->create($from_number, $to_number, $url_or_AppSID, array(
    'TwilioParam1' => 'value1',
    'TwilioParam2' => 'value2',
    'MyCustomParameter1' => 'CustomValue1',
    'MyCustomParamete2' => 'CustomValue2'
));

Then I expected to receive those parameters when Twilio requested my $url_or_AppSID (my TwiML App) but it did not happen. I know that a possible way to do that is building an URL adding those parameters in query string and passing my custom URL in $url_or_AppSID parameter but this force me to set GET method and I wanna pass my custom parameters through a POST request, not GET. Also it's probably that I have to use an AppSID which has already a request URL registered via POST.

Is there a way to pass custom parameters using POST method?

like image 788
Delmo Avatar asked May 25 '15 01:05

Delmo


1 Answers

Finally, I received a response from Twilio Support:

Unfortunately you cannot add custom parameters such as below. You are correct in that the only way you would be able to do this is add the parameters to the querystring and we would just pass those parameters along to your application.

Then I sent them a feature request:

I think this should be taken in account for future release.

They replied me:

If this feature request does not already exist. I will add it.

Well stay tuned for future release.

like image 139
Delmo Avatar answered Sep 25 '22 15:09

Delmo