Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
88 views
in Technique[技术] by (71.8m points)

php - Twilio web-hook implementation using custom object

Ideally, the case is when we send SMS to members they should be replying back and we have configured the web-hook but in the web-hook, we would like to receive a custom array or object as well this way we can redirect that text or reply of SMS to a specific group.

  $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

I have set message webhook so, when someone should reply on my message I can come to know via web-hook.

following is the response that I got from Twillio.

Now I want something like when someone will reply to my SMS i should get group id and other things so I can handle the object in my code. enter image description here

question from:https://stackoverflow.com/questions/65626353/twilio-web-hook-implementation-using-custom-object

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...