2017 © Pedro Peláez
 

yii2-extension yii2-twilio

Twilio extension for Yii2 framework

image

timur560/yii2-twilio

Twilio extension for Yii2 framework

  • Wednesday, March 14, 2018
  • by timur560
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 200 % Grown

The README.md

reinvently/yii2-twilio

Installation

Via composer:

$ composer require reinvently/yii2-twilio

Configure

Add the following config to the components section to the config/web.php, config/console.php, etc.:, (*1)

...
    'twilio' => [
        'class' => 'Reinvently\Twilio\Twilio',
        'number' => 'XXXXXXXX', // phone number
        'retries' => 5, // call retries in fail cases
        'account' => [
            'sid' => 'ACXXXXXXXXXXXXXXXXXXXXXX',
            'token' => 'XXXXXXXXXXXXXXXXXXXXXXXX',
        ],
        'twiMLApp' => [
            'sid' => 'APXXXXXXXXXXXXXXXXXXXXXX',
        ],
        'apiKey' => [
            'sid' => 'SKXXXXXXXXXXXXXXXXXXXXXX',
            'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXX',
        ],
        'configurationProfile' => [
            'sid' => 'VSXXXXXXXXXXXXXXXXXXXXXX',
        ],
    ],
...
]

Replace the necessary fields with your own twilio account data, which you can find in twilio control panel, (*2)

Methods Reference (TODO)

generateCapabilityToken

generateVoiceAuthToken()

generateVideoAuthToken

generateChatAuthToken

sendSms

call

Usage

Sample useage in REST API controller:, (*3)

namespace app\controllers;

use yii\rest\ActiveController;

class ApiController extends ActiveController
{
    public $modelClass = '';

    public function actionGetVoiceAuthToken() {
        return \Yii::$app->twilio->generateVoiceAuthToken();
    }
}

The Versions

14/03 2018

dev-master

9999999-dev

Twilio extension for Yii2 framework

  Sources   Download

MIT

The Requires

 

by Reinvently

yii2 sms twilio call

14/03 2018

1.0

1.0.0.0

Twilio extension for Yii2 framework

  Sources   Download

MIT

The Requires

 

by Reinvently

yii2 sms twilio call