问题
I am attempting to set a StatusCallback on outgoing SMS messages using twilio/sdk - see https://github.com/twilio/twilio-php
The problem I'm running into is that it would appear that the StatusCallback option should be included in an array after the Body, like so:
$this->twilio->account->messages->sendMessage(
"+{$this->client->number}",
"+{$phone->number}",
$outgoing,
array('StatusCallback' => 'http://foo.bar/status')
);
.. but Twilio now supports MMS messaging and seems to be considering this a reference to media. What am I missing? How can I use the Status Callback with this helper library?
Thanks!
回答1:
Twilio evangelist here.
Check out this post and answer which seem to fit your question:
How to add the callback URL to Twilio SMS sending code?
Specifically notice that when building the array in the fourth parameter you can actually specify key/value pairs, where the key is the parameter you're trying to send Twilio.
Hope that helps.
来源:https://stackoverflow.com/questions/24478619/twilio-twilio-sdk-php-status-callback-for-messages