toku / caas_sdk
Toku CaaS SDK
v1.0
2021-10-18 04:38 UTC
Requires
- php: >=7.0
README
Documentation
You can find the online document here.
Installation
You can install the SDK using composer:
composer require toku/caas_sdk
Use command below to regenerate the classes installed:
composer dump-autoload
Quick Start - Call Handle
Autoloading
Require/include autoloading if your PHP framework does not handle autoloading.
require __DIR__ . '/vendor/autoload.php';
Class
Use the call controller class to form call handle command
use \Toku\CaaS\V1\CallHandle\CallController;
Instance
Create a new call controller instance
$ctrl = new CallController();
Call Handle Command
Use the call controller to send call handle command such as PlayTTS command.
$ctrl->PlayTTS("This is a test message", "en", "f")->Response();
You can also send multiple command.
$ctrl->PlayTTS("This is a test message one", "en", "f")-> PlayTTS("This is a test message two", "en", "f")-> Response();
Sample Code
<?php //Require autoloading file if your framework does not handle autoloading require __DIR__ . '/vendor/autoload.php'; //Use the call controller class to form call handle command use \Toku\CaaS\V1\CallHandle\CallController; //Create a new call controller instance $ctrl = new CallController(); //Optional header('Content-Type: application/json'); //Use the call controller to send call handle command such as PlayTTS command $ctrl->PlayTTS("This is a test message", "en", "f")-> Response(); ?>