Skip to content

ittell-com/call2fa-php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP SDK for Call2FA

This is a library you can use to access the Call2FA service (a call as the second factor in an authorization pipeline)

Installation

Download dependencies:

composer install

Example

This simple code makes a new call to the +380631010121 number:

<?php

use Ittell\Call2FA\Client;
use Ittell\Call2FA\ClientException;

require __DIR__ . '/vendor/autoload.php';

// API credentials
$login = '***';
$password = '***';

// Configuration for this call
$callTo = '+380631010121';
$callbackURL = 'http://example.com/handler.php';

try {
    // Create the Call2FA client
    $client = new Client($login, $password);

    // Make a call
    $client->call($callTo, $callbackURL);

    echo "Wait the call!";
} catch (ClientException $e) {
    // Something went wrong, we recommend to log the error
    echo "Error:";
    echo "\n";
    echo $e;
}

More examples are in the examples folder.

Releases

No releases published

Packages

No packages published

Languages