Announcement

Collapse
No announcement yet.

Php Api

Collapse
X
 
  • Filter
  • Time
Clear All
new posts

    Php Api

    HI Guys

    I'm looking at making our phone system talk to PHP but i can not find a way to look up a contact via the PHP API. Can you point me in the right direction?

    Also is there a way to POP a CommitCRM screen application via the API? Or if not is there a way to open a chrome window with the account already open via a URL?

    Re: Php Api

    Thank you for asking. If I get this correctly you are looking for a way to have an incoming call look for a contact in your RangerMSP's database and the pop a message with the contact details. This can be implemented, though you probably won't be using PHP for that but rather C#, C++ or VB.NET and use the API. Using the API you can query the Accounts and Contacts database and get the entire record details, and then your custom program can simply pop a message with the details, also - your program will be able to open a URL that will take the user directly the Contact/Account details page as displayed in the Web portal. Please ping us once you get to this phase and we'll provide you with the relevant details on how to construct the URL. Hope this helps.

    Comment


      Re: Php Api

      Thanks Going to be using vb.net

      Comment


        Re: Php Api

        I was looking for a way to look up names form phone numbers from PHP so i could get the CDR records in the freeswitch system to work correctly. I can get it to query a mysql database but at commit dont have a connector for centos to its DB i need to use the PHP API. Do you know if this can be done. A simple http://commitip:8888/search.php?number=555555555 returns Bill?

        Comment


          Re: Php Api

          That's doable. You'll need to write a small program that listens on any port you choose, it will then parse the URL, get the phone number and will look it up. Hope this helps.

          Comment


            Re: Php Api

            Just use odbc drivers. Works perfectly for what you are describing. Though you may need to use IIS and Windows

            Comment


              Re: Php Api

              What odbc connector did you use? Are you interested in sharing your code you used for the look ups?

              Thanks

              Comment


                Re: Php Api

                Info on ODBC: here

                Note, I think you need CommitCRM SQL version to use this.

                Setup the ODBC connections as a system DSN on a windows box.

                Then in IIS / Apache on that same windows box, in PHP use something like this, for example:

                $conn=odbc_connect('CommitCRM','','');

                //get a listing of companies that match phone # - btw, I didn't test this query. :)
                //note that you may want to sanitize the phone # field - like what if there are - or ( or )'s?
                $sql="select fullname, recid from cards where phonenumber like '%some cleaned up string%' order by fullname desc";
                $rs=odbc_exec($conn,$sql);
                while (odbc_fetch_row($rs)){
                $employeenamesAr[odbc_result($rs,2)]=trim(odbc_result($rs,1));
                }

                Comment


                  Re: Php Api

                  Thanks. I got it working. Just a few notes for others. Need to use 32bit ODBC. And i had to change some of the Field Names. But its a start. Thanks
                  <?php
                  $conn=odbc_connect('CommitCRM','','');
                  if ($conn) {
                  //echo "Connection established.";
                  } else{
                  die("Connection could not be established.");
                  }

                  //get a listing of companies that match phone # - btw, I didn't test this query. :)
                  //note that you may want to sanitize the phone # field - like what if there are - or ( or )'s?
                  $sql="select FULLNAME , recid from cards where PHONE1 like '%some cleaned up string%' order by FULLNAME desc";
                  $rs=odbc_exec($conn,$sql);
                  while (odbc_fetch_row($rs)){
                  echo $employeenamesAr[odbc_result($rs,2)]=trim(odbc_result($rs,1));
                  }

                  Comment

                  Working...
                  X