INC. ALL RIGHTS RESERVED. TwiMLの一例 • 指定したmp3ファイルを 再生 <?xml version="1.0" encoding="UTF-8"?> <Response> <Play>https://api.twilio.com/cowbael.mp3</Play> </Response>
INC. ALL RIGHTS RESERVED. アプリケーションから音声通話を発信 const twilio = require('twilio')( process.env.ACCOUNT_SID, process.env.AUTH_TOKEN ); twilio.calls.create({ from : process.env.TWILIO_NUMBER, to: process.env.MY_NUMBER, twiml: '<Response><Say language="ja-JP">こんにちは世界。アプリから通話しています。/Say></Response>' }).then (call => console.log(call.sid));
INC. ALL RIGHTS RESERVED. webhookリソース https://www.twilio.com/docs/glossary/what-is-a-webhook https://www.twilio.com/docs/usage/webhooks https://www.twilio.com/docs/usage/webhooks/getting-started-twilio-webhooks
INC. ALL RIGHTS RESERVED. https://api.twilio.com POST /2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Calls.json Authorization: 'Basic bGlmdG9mZg==' To=YOUR_NUMBER&From=TWILIO_NUMBER&Twiml=<Response><Say> HTTP/1.1 200 OK { "account_sid": $TWILIO_ACCOUNT_SID, "date_created": "Wed, 17 Mar 2021 03:00:00 +0000", ... }