Twilio - twilio/sdk PHP Status Callback for messages

冷暖自知 提交于 2019-12-11 11:43:24

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!