samiaraboglu/alotech-api-bundle

Symfony AloTech Api Bundle

1.0.4 2019-03-06 16:10 UTC

This package is auto-updated.

Last update: 2024-11-29 05:38:46 UTC


README

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();
}