Methods
Objects
SDK Installation Guide
How to install the CALLR PHP SDK with and without PHP Composer
Summary
The installation and usage of the php-sdk requires the following:
Composer (https://getcomposer.org/download/) is recommended for use with the sdk and for managing your project dependencies.
The download page contains instructions and necessary files for installation on Windows and other platforms.
{
"require": {
"callr/sdk-php": "^0.11"
}
}
<?php
require 'vendor/autoload.php';
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing callr/sdk-php (v0.x)
Loading from cache
Writing lock file
Generating autoload files
If you wish to use the sdk without the dependency management of Composer it is possible with the following steps
// require source objects
require '../src/CALLR/Api/Client.php';
require '../src/CALLR/Api/Request.php';
require '../src/CALLR/Api/Response.php';
require '../src/CALLR/Api/Exception/LocalException.php';
require '../src/CALLR/Api/Exception/RemoteException.php';
require '../src/CALLR/Api/Authentication/AuthenticationInterface.php';
require '../src/CALLR/Api/Authentication/LoginPasswordAuth.php';
// get api client object
$api = new \CALLR\API\Client;
// set authentication credentials
$api->setAuth(new CALLR\API\Authentication\LoginPasswordAuth($login, $password));
print_r($api->call('system.get_timestamp',[]));
...
// require source objects
require 'vendor/autoload.php'; // Composer
require '../src/CALLR/Realtime/Server.php';
require '../src/CALLR/Realtime/Request.php';
require '../src/CALLR/Realtime/Response.php';
require '../src/CALLR/Realtime/CallFlow.php';
require '../src/CALLR/Realtime/Command.php';
require '../src/CALLR/Realtime/Command/Params.php';
require '../src/CALLR/Realtime/Command/ConferenceParams.php';
// get callflow object
$flow = new CallFlow;
...