使用自定义对象的 Twilio 网络钩子实现

问题描述

理想情况下,当我们向会员发送 SMS 时,他们应该回复并且我们已经配置了 web-hook 但在 web-hook 中,我们也希望通过这种方式接收自定义数组或对象将该文本或短信回复重定向到特定组。

  $account_sid = '<SID>';
    $auth_token = '<AUTH_TOKEN>';
    // In production,these should be environment variables. E.g.:
    // $auth_token = $_ENV["TWILIO_AUTH_TOKEN"]

    // A Twilio number you own with SMS capabilities
    $twilio_number = "<TWILIO_NUMBER>";
    
    $client = new Client($account_sid,$auth_token);
    $result = $client->messages->create(
        // Where to send a text message (your cell phone?)
        '<TO_NUMBER>',array(
            'from' => $twilio_number,'body' => 'Hello!!'
        )
    );

enter image description here

我设置了消息网络钩子,所以当有人回复我的消息时,我可以通过网络钩子来知道。

以下是我从 Twillio 得到的回复。

现在我想要一些东西,比如当有人回复我的短信时,我应该得到组 ID 和其他东西,以便我可以在我的代码中处理对象。

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)