INC. ALL RIGHTS RESERVED. 確認コードの送信先(電話番号、 Emailアドレス)、
送信方法(SMS、電話、Email)を設定
コードの送信 // AccountSidとAuthTokenでクライアントを初期化 const client = require('twilio')( process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN); let verify_service_sid = 'VAxxxxxxxxxxxxxxxxx'; let verify_to = '+8190xxxxxxxx'; // 事前にID/PWなどの認証を行う // コードを送信 client.verify.services(verify_service_sid) .verifications .create({ to: verify_to, channel: 'sms'}) //sms, call, email .then(verification => console.log(verification)); { sid: 'VExxxxxxxxxxxxxxx', serviceSid: 'VAxxxxxxxxxxxxxxx', accountSid: 'ACxxxxxxxxxxxx', to: '+8190xxxxxxxx', channel: 'sms', status: 'pending', valid: false, lookup: { carrier: { mobile_country_code: '440', type: 'mobile', error_code: null, mobile_network_code: '50', name: 'KDDI' } }, amount: null, payee: null, sendCodeAttempts: [ { channel: 'sms', time: '2020-04-20T22:03:09.112Z' } ], dateCreated: 2020-04-20T22:03:09.000Z, dateUpdated: 2020-04-20T22:03:09.000Z, url: … }