samiaraboglu/alotech-api-bundle

Symfony AloTech Api Bundle

安装数: 12,639

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

1.0.4 2019-03-06 16:10 UTC

This package is auto-updated.

Last update: 2024-08-29 04:54:38 UTC


README

Latest Stable Version Total Downloads License

使用AloTech PHP API

下载包

$ composer require samiaraboglu/alotech-api-bundle

启用包

在项目的 app/AppKernel.php 文件中注册包

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

配置

将以下内容添加到 config.yml

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

示例 - 点击通话

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