Add leads to OSDial via API

ViciDial and GoautoDial are two fantastic predictive dialers but when I get familiar with OSDial I find it more simple and useful than others . Behind its simple interface, it has powerful API implementation as well . APIs to add lead , List , Campaign , etc  . This is a step by step document on one of its practical APIs to add lead . I used it to integrate VTiger CRM to the telephony system .

Step 1 : Enable API access for admin ( or any ) user . We will use this user to access the API .
To enable the API access go to Agents menu and select admin .

And set admin API access to Y

Step 2 : For importing leads you need to create an XML file with Admin username and your admin password .

<?xml version='1.0' standalone='yes'?>
<api user="admin" pass="mypassword" function="add_lead" mode="admin" test="0" debug="0" vdcompat="0">
      <address1>Vila Street</address1>
      <comments>This is a test of the lead loading.</comments>
          <additional_field form="CREDITCARD" field="NAME">Omid Mohajerani</additional_field>
          <additional_field form="CREDITCARD" field="ADDRESS">9928 CC Lane</additional_field>


Step 3 : Send the sample.xml file via POST method to OSDial admin api.php

  $filename = "sample.xml";
  $handle = fopen($filename, "rb");
  $data = '';
  while (!feof($handle)) {
     $data .= fread($handle, 8192);
<form action="https://OSDIAL-IP-ADDR/admin/api.php" method="post" enctype="multipart/form-data">
<textarea name="xml" rows="30" cols="80"><?php echo $data; ?></textarea>
<input type="submit" value="OK" />

OSDial is the popular full-featured predictive dialer, that uses Open Source licenses able to dial in every imaginable way .
VTiger is a popular Open Source CRM System based on PHP and MySQL.


Post a Comment