New vicidial api wrapper

Discussions about development of VICIDIAL and astGUIclient

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

New vicidial api wrapper

Postby fperdomo » Wed Mar 03, 2021 10:24 am

Hello all,

I was looking into an API wrapper for Vicidial API and I saw that is out of update (the last update was on Oct 24, 2017) so create my own version so will make it easy to integrate any PHP application. On this version, I added support to all Vicidial API functions.

Features:
- Added HTTPS support
- All Vicidial Agent API support
- Created documentation based on Vicidial on a Markdown page instead of a text file so gonna be easy to read it.
- Composer installation support
- Easy to integrate any CRM, Ticket system, or PHP based application
- Focus on simplicity and easy to use

Repository
https://github.com/masterfermin02/vicidial-api-wrapper

Code: Select all
<?php

require_once 'vendor/autoload.php';

use Vicidial\Api\Wrapper\Agent\Client;

try {
     $vicidialAPI = new Client("127.0.0.1", "6666", "123");
     $agent_user = '1000';
     $vicidialAPI->ra_call_control($agent_user, [
        'stage' => 'INGROUPTRANSFER',
        'ingroup_choices' => 'DEFAULTINGROUP',
        'value' => 'Y0316001655000402028'
     ]);
} catch (Exception $e) {
     echo 'Exception: ',  $e->getMessage(), "\n";
}
best regards
fperdomo
 
Posts: 8
Joined: Fri May 20, 2016 8:43 pm

Re: New vicidial api wrapper

Postby mflorell » Wed Mar 03, 2021 10:30 am

Thanks for posting!
mflorell
Site Admin
 
Posts: 17804
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: New vicidial api wrapper

Postby carpenox » Wed Mar 03, 2021 12:30 pm

Good shit, great post
Leap 15.2 | Version: 2.14-822a | BUILD: 210715-1248| SVN Version: 3483 | DB Schema Version: 1639 | Asterisk 13.38.2-vici
www.CyburDial.net -:- 844-PC-SATA-2 -:- My Blog: http://vicidial.blog -:- Whatsapp: +19549477572 -:- Skype: live:carpenox_3
carpenox
 
Posts: 1478
Joined: Wed Apr 08, 2020 2:02 am
Location: Coral Springs, FL

Re: New vicidial api wrapper

Postby fperdomo » Sun Mar 07, 2021 4:45 pm

Thanks @mflorell and @carpenox. I also added support to the no agent API or admin API.

https://github.com/masterfermin02/vicid ... -agent-api

Example:
Code: Select all
<?php
   
    require_once 'vendor/autoload.php';
   
    use Vicidial\Api\Wrapper\Admin\Client;
   
    try {
        $admin = new Client("viciexperts.com/admin_demo/", "12345", "12345");
        echo $admin->moh_list([
            'format' => 'selectframe',
            'comments' => 'fieldname',
            'stage' => 'date'
        ]);
    } catch (Exception $e) {
        echo 'Exception: ',  $e->getMessage(), "\n";
    }
best regards
fperdomo
 
Posts: 8
Joined: Fri May 20, 2016 8:43 pm


Return to Development

Who is online

Users browsing this forum: No registered users and 7 guests