How to get notified when SMS Status changes from 'Queued' to 'Sent'?

前端 未结 1 1834
孤独总比滥情好
孤独总比滥情好 2021-01-04 09:25

Hello,
I am trying to learn Twilio API.
When I [send SMS through php][1] script.. twilio returns a response object with status = \'queued\'. Now I

相关标签:
1条回答
  • 2021-01-04 10:02

    You're on the right track looking to the StatusCallback. When using the Twilio PHP Library any optional parameters can be set using an array as the last argument.

    <?php
    $sms = $client->account->sms_messages->create(
      "1235551234", 
      "1235554321",
      "Hey Friend, Monkey Party at 6PM. Bring Bananas!",
      array('StatusCallback' => 'http://example.com/sms/status.php')
    );
    

    When the message is sent (or if it fails) the data will be passed to the StatusCallback url.

    0 讨论(0)
提交回复
热议问题