Skip to content

samiaraboglu/alotech-api-bundle

Repository files navigation

alotech-api-bundle

Latest Stable Version Total Downloads License

Use the AloTech PHP API.

Download the Bundle

$ composer require samiaraboglu/alotech-api-bundle

Enable the Bundle

Registered bundles in the app/AppKernel.php file of your project:

<?php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Samiax\AloTechApiBundle\SamiaxAloTechApiBundle(),
        );
        // ...
    }
    // ...
}

Config

Add this to config.yml:

samiax_alo_tech_api:
    username: "{USERNAME}"
    app_token: "{APP_TOKEN}"

Example - Click 2 Call

/**
 * @Route("/alotech/click2/call", name="alotech/click2/call")
 */
public function callAction(Request $request)
{
    $service = $this->get('samiax_alo_tech_api.alotech');

    $service->login('{EMAIL}');

    $service->click2->call([
        'phonenumber' => '{PHONE_NUMBER}',
        'hangup_url' => '{YOUR_HANGUP_URL}'
    ]);

    return new Response();
}