Git Product home page Git Product logo

goapiv2's Introduction

goAPI

The GOautodial APIs allow you to perform operations and actions within GOautodial from external applications. This allows GOautodial to integrate seamlessly with third party software and custom code.

Access to the APIs are via HTTPS and authentication is done via username and password.

To install (need to have a working GOautodial v4):

cd /var/www/html
git clone https://github.com/goautodial/goAPIv2

Documentation (incomplete): https://drive.google.com/drive/folders/1ERrp_QdSVBsIpPKzoeU2hNQikCYSKJH0?usp=sharing.


Sample PHP code to create campaign:

$postfields = array(
  'goUser' => $goUser,
  'goPass' => $goPass,
  'goAction' => ‘goAddCampaign’,
  'session_user' => $session_user,
  'responsetype' => 'json',
  ‘campaign_id’ => ‘12231977’,
  ‘campaign_name’ => ‘Testcampaign’,
  ‘campaign_type’ => ‘outbound’, 
  ‘dial_prefix’ => ‘CUSTOM’, 
  ‘custom_prefix’ => ‘9’,
  ‘dial_method’ => ‘MANUAL’, 
  ‘auto_dial_level’ => ‘OFF’, 
  ‘campaign_recording’ => ‘NEVER’, 
  ‘answering_machine_detection’ => ‘8369’, 
  ‘session_user’ => ‘$session_user’, 
  ‘user_group’ => ‘ADMIN’
  ‘active’ => ‘Y’
  );

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
$data = curl_exec($ch);
curl_close($ch);

Sample return:

Success
HTTP 200:
{result: "success"}

Failure
HTTP 400:
{
"code" : "40001"
"result" : "Error: Missing required parameters"
}

Curl utility:

curl 'https://DOMAINNAME/goAPIv2/goCampaigns/goAPI.php?goAction=goAddCampaign&goUser=goAPIuser&goPass=ENCRYPTED_PASSWORD&responsetype=json&campaign_id=12231977&campaign_name=CAMPAIGN_NAME&campaign_type=outbound&dial_prefix=CUSTOM&custom_prefix=9&dial_method=MANUAL&auto_dial_level=OFF&campaign_recording=NEVER&answering_machine_detection=8369&session_user=admin&user_group=ADMIN'

The encrypted password can be derived from the pass_hash column in the vicidial_users table under the asterisk database. Or use /var/www/html/bin/pass_hasher.php to generate the encrypted password.

OpenAPI Spec

There is also a work-in-progress openapi spec composed by @God-Zalo which can be used for code-generating client sdks in different languages:

goapiv2's People

Contributors

demianb avatar mmixx avatar thompatacsil avatar alexanderabenoja avatar nathanielcabanban avatar kitchenu avatar chgpbase avatar infinitr3d avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.