Connecting Glide to your existing client database (integration using the Glide API and PHP)

This tutorial will demonstrate how to integrate Glide with your existing client database. Thus eliminating the need to update both systems when you get a new client, or need to update an existing client’s data.

This tutorial deals with a hypothetical client database, but could be customised to connect to various practice management packages with relative ease. Please contact us should you have any questions regarding integrating Glide with your particular client database software.

  • Enable the Glide API

Log into your Glide system as your ‘super user’. This is the user that created the Glide system and can access the account control panel.

Go to: Config -> System Options

Click: Glide API

Click: Enable API

You will now see a long series of letters and numbers that you will use to access your Glide system from another program or website. This is referred to as a ‘key’, make a note of this as you will need it later.

A note about security: Currently we are offering access to our API using a key system. Please keep this key safe as it alone can be used to access your Glide data. We recommend that you disable then enable your API access to force-generate another key if you are concerned that your key may have become known to other parties.

  • Integrating with other systems

Our customers have requested to integrate Glide with various other software packages, including Digita, CCH and Iris. Using our API it should be possible to integrate with any other system that also offers either an open database or an API. Due to the sheer number of other systems available on the market it is not possible to write an integration tutorial for each system, so in this tutorial we will create our own simple client database running on a machine with internet access that uses the MySQL database.

We recommend that you speak with a representative from the company that supplies your existing client database to ascertain if an API is available for that particular system. In cases where an API is not available it may be that the database is structured in such a way that you or your programmer can manually create an integration routine such as the one demonstrated in this tutorial.

  • Creating a client via the Glide API

To begin with I will create the simplest possible example to demonstrate how easy it is to interact with the Glide system via the API. For this example you will need access to a system running PHP. PHP is a programming language specifically designed for web servers and is widely used across the Internet. You can download PHP for your system at (http://www.php.net).

For the remainder of this tutorial I will assume that you have a working PHP environment, either on a remote web server or on your local machine.

To access Glide via PHP we will be using the cURL library, this is a PHP component that is typically installed when you install PHP. If your script returns many errors that refer to curl, then you may need to do a Google search for ‘installing curl on php’ and follow the instructions.

Here is a PHP script to remotely create a new client on your Glide system. The code is included here to aid understanding, but is also available as a separate download at the end of this tutorial.

Example 1 – Adding a new client via PHP/Glide API

 
<?php
// This is your Glide API key - you can find it at https://www.whatsglide.com/i/ams_sysconfig.php#glideapi
$key = "c4d8e196d529d34e477175a36f1cee9810a3026d3a631b9a13b2fb1720c24087";
 
$command = "/clients/create";				// The API command that we will be using
$baseurl = "http://api.whatsglide.com";		// Create the request URL
$url = $baseurl.$command."?key=".$key."&returnFormat=1";	// Build the URL that we will call
 
$ch = curl_init();									// Initiate curl
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 	// Disable SSL verification
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);					// Set the url that we wish to call
 
// Now we build up a PHP array with the data for our new client - these are the fields that we can supply
$fields = array(		'name' => urlencode("New Client Tutorial 1"),
						'title' => urlencode(""),
						'firstn' => urlencode(""),
						'code' => urlencode("5610"),
						'type' => urlencode("1"),
						'opt_corptax' => urlencode("1"),
						'opt_nextyearend' => urlencode("2016-01-01"),
						'ucode' => urlencode("1005"),
						'opt_incorpdate' => urlencode("2010-01-01")		
						);
 
// Turn the above array into a string that we can pass as POST fields
$fields_string = "";
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
$fields_string = rtrim($fields_string, '&');
curl_setopt($ch,CURLOPT_POST, count($fields));			// Set the cURL options for POST data
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
 
$curl_result = curl_exec($ch);			// Execute our request (call Glide and make our request)
curl_close($ch);		// Close down cURL - as we have done what we wished to do
 
$array_result = array();	// PHP array to place our decoded data into
$array_result = (array)json_decode($curl_result, true);
 
print_r($array_result);		// For now we will just print out what we have gotten back from Glide
?>

 

Before attempting to run this code, first log into your Glide system and check the number of clients that you have in the database. For example on our demo system we currently have 10 clients.

 

T1-PreClients

 

Save the code as a file named glide_api__phpdemo.php, then to execute the code (that is, to have the computer inspect the file and follow the instructions that you have listed), run this command.

php –f glide_api__phpdemo.php

This is the output that I see on my machine when running the script. I am running the script on a Linux server, if you are using Windows then what you see may be slightly different, but the output should be the same.

You should see ‘Status – OK’. This is output that has been returned from the Glide server, and will alert you to any errors, or confirm success.

 

T1-CL1

 

Now switch back to your web browser, and to your Glide installation. Refresh the page that shows your list of clients, if all has gone well then you will see that the new client has been added to your Glide client database.

 

T1-PostClients

 

This is the simplest possible example of how to use the Glide API from a remote PHP script. Alongside creating and editing clients the Glide API includes features to manipulate jobs, users and tasks. For full details please examine the Glide API documentation.

  • Adding Additional Client Fields via the API

One of the many powerful features of Glide is the ability to create your own fields to describe additional information that you wish to store in your client database.

For example, most client systems have by default various additional fields such as email, address and telephone number. These fields are included as ‘additional fields’ to enable users to customise the fields to their specific requirements.

Setting these fields via the API is straightforward, and can be done as soon as we have confirmation that our new client has been created.

For this example we will set the telephone number for a client. To do this we need to know the special identification code that represents the telephone number field in the Glide database.

Go to your Glide ‘Config’ menu, then click on ‘Database Codes Summary’. You will see a list of objects in your Glide system. Each item has a number, which is the internal unique identification number, when referring to a particular item via the Glide API you will use this number instead of the name of the item.

 

T1_ACF_codes

 

So for example, to set the telephone number for a client, we make a note of the database code for ‘Phone 1’, which is 220, we will use this code when telling the API which field needs updating.

Below you can see that our new client currently has no value set for the ‘Phone 1’ field.

T1-NC-PreUp1

 

Below is a PHP script to set the telephone number for a particular client. We include the client’s unique identification code in the request so that Glide knows which client to update. This code is user editable, you should set it to the unique reference code that you use internally in your organisation to refer to the client. It should be unique across your client database.

 

 
<?php
// This is your Glide API key - you can find it at https://www.whatsglide.com/i/ams_sysconfig.php#glideapi
$key = "c4d8e196d529d34e477175a36f1cee9810a3026d3a631b9a13b2fb1720c24087";
 
$clientID = "1005"; 				// This is the unique client code that you specified at creation
$fieldID = "220";					// This the database field code
$value = urlencode("07735 574734"); // This is the data to insert into the field, note we need to use urlencode
 
$command = "/clients_by_id2/$clientID/set/$fieldID/$value";				// The API command that we will be using
 
$baseurl = "http://api.whatsglide.com";		// Create the request URL
$url = $baseurl.$command."?key=".$key."&returnFormat=1";	// Build the URL that we will call
 
$ch = curl_init();									// Initiate curl
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 	// Disable SSL verification
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);					// Set the url that we wish to call
 
$curl_result = curl_exec($ch);			// Execute our request (call Glide and make our request)
curl_close($ch);		// Close down cURL - as we have done what we wished to do
 
$array_result = array();	// PHP array to place our decoded data into
$array_result = (array)json_decode($curl_result, true);
 
print_r($array_result);		// For now we will just print out what we have gotten back from Glide
?>

 

Save the script as glide_api__phpdemo_2.php then run it on your machine/server in the same way that you ran the previous script

php –f glide_api__phpdemo_2.php

 

T1-NC-PostUp1

 

Now return to your web browser and refresh the client information page for the new client. You will see that the ‘Phone 1’ field has been completed with the data we supplied through the API.

This process can be repeated for each of the fields where needed. Additionally the same method can be used to update fields that you have created. Glide supports many different types of field including date, string, long string, number, user, email address, website.

These basic examples have shown how to update Glide remotely from a PHP script. However they are not of any practical use beyond showing the basic techniques and programming ideas involved. The examples that follow demonstrate how to connect the PHP code to a database system and monitor for changes, connecting to Glide when required to create or update clients.

  • Building An Integration Solution

As previously explained, there are many different client database solutions on the market and so writing a tutorial for each piece of software is not practical, therefore I will create an extremely simple client database myself and then integrate it with Glide. You can be sure that commercial practice management systems will have far more complicated client databases, however the underlying database ideas will be the same. This example could be expanded to work perfectly well with many of these systems and their client databases.

We will be using MySQL, which is an open source database available freely at www.mysql.com. Most commercial practice management systems will use Microsoft SQL Server, although the PHP code that follows could connect to an MS SQL Server instance with minimal changes.

With a working MySQL installation create a database called ‘clientdb’, then create a table called ‘clients’. The MySQL code to do this is as follows.

 
CREATE DATABASE clientdb;
USE clientdb;
 
CREATE TABLE clients (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(32), code VARCHAR(16), incorp DATETIME, phone VARCHAR(32));

We have included fields for the client’s name, phone number, incorporation date and a unique code which we will use to refer to the client without needing to spell out their entire name. We also have a field named ‘id’, this is a number which refers to each entry in our table and is unique for each client. MySQL kindly sets this number automatically and increments it by one each time.

Next we will add 3 clients to our simple client database, below are the MySQL commands to execute. You will see that the process is pretty straightforward.

 
INSERT INTO clients (name, code, incorp, phone) VALUES ('Smiths and Co', 'C101', '2008-01-01', '07734834495');
INSERT INTO clients (name, code, incorp, phone) VALUES ('JT Tools', 'C102', '2004-05-03', '07734048237');
INSERT INTO clients (name, code, incorp, phone) VALUES ('Lean City Gym', 'C103', '2000-11-22', '07734834495');

 

Finally, enter this command to ask MySQL to print out the contents of our table. As you can see this is a simple but functional client database. More elaborate solutions available commercially will most likely provide a graphical interface or a web interface to remove the need to deal with the database directly. However, the underlying tables will be very similar.

SELECT * FROM clients;

 

The Goal

Our goal is to create a solution which will automatically update Glide with any changes we make to our local database. This functionality will mean we can work on our client database and have Glide updated without any effort on our part, removing the need to update both systems.

When implementing your own integration solution, replace the example database with the name and location of the client database table used by your practice management software. Additionally you will need to know the layout of the client tables. Some solutions will provide an API to access the client data, in which case you should use that instead of directly accessing the tables.

Requirements

What we need now is a way of knowing when the above database has been changed, because we will then be updating Glide with the changes. This would be when a new client is created or when an existing client entry is changed.

The smartest way to do this is to have a log of changes, and check it at frequent intervals. In modern database systems this is done using a ‘trigger’. Both Microsoft SQL Server and MySQL support triggers.

Firstly we need to create a table to hold a list of changes as they occur in the client table.

 
CREATE TABLE changes (id INT(6) NOT NULL AUTO_INCREMENT PRIMARY KEY, client INT(6), done INT(6), changetype ENUM('NEW','EDIT') NOT NULL, changetime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);

Creating Triggers

The code to create our trigger is as follows.

 
DELIMITER $$;
CREATE TRIGGER clients_insert AFTER INSERT ON clients FOR EACH ROW BEGIN INSERT INTO changes (client, changetype) VALUES (NEW.id, 'EDIT'); END$$
DELIMITER ;

 

(Note: the two delimiter commands are needed to allow us to use the ; in our statement. Do a Google search for further information)

As you can see what we are asking is that MySQL inserts a row into the changes table every time that a new row is inserted into the clients table. We place the internal client ID code and the fact that it was an edit into the new row in the changes table.

Next we create a second trigger, this will fire when a row on the clients table is updated (edited). The MySQL statements are very similar with just a couple of adjustments.

 
DELIMITER $$;
CREATE TRIGGER clients_update AFTER UPDATE ON clients FOR EACH ROW BEGIN INSERT INTO changes (client, changetype) VALUES (NEW.id, 'NEW'); END$$
DELIMITER ;

Now we need to test the triggers to see if they execute correctly. To do this add a new client to your database using this command.

 
INSERT INTO clients (name, code, incorp, phone) VALUES ('Sam and Son Bakery', 'C505', '1980-11-04', '07744988473');

 

Then check the changes table with the command.

 
SELECT * FROM changes;

 

If things have worked correctly you should see something similar to what I have below. The changes table will have a single entry, which notes that a new row was created for a client with the current date and time.

 

T1-Dbready

 

I then updated the client to test the update trigger. You can do this with this command.

 
UPDATE clients SET phone = '07707123456' WHERE code = 'C505';

 

Now if you view the changes table you should have two entries, the second one noting the edit that we made to that client. If these changes have been correctly noted then your triggers are working correctly, if not then I recommend rereading this part of the tutorial and not moving forward until the triggers are working correctly, as we need them to work for the solution to function correctly.

Creating a script to monitor for changes

The next part of our solution is a small PHP script which will run frequently and check this changes table for activity on our client database. The example uses a file called ‘db.php’ which connects to our MySQL database using PHP’s PDO library. I have not listed the code for that file here, but it is available in the download at the end of the tutorial.

 

 
<?php
 
// We now look at the changes table to see what has changed on the clients database, then communicate any changes to Glide
include_once("db.php");	// Our database connection code - with correct username/password
 
// This is your Glide API key - you can find it at https://www.whatsglide.com/i/ams_sysconfig.php#glideapi
$gkey = "c4d8e196d529d34e477175a36f1cee9810a3026d3a631b9a13b2fb1720c24087";
 
// Firstly mark all those changes that we are going to deal with this time
$sql = "UPDATE changes SET done = 1 WHERE done = 0";
try { $result = D::i()->query($sql); } catch(PDOException $e) { $error = 1; echo "Error"; echo $e->getMessage(); }
 
// Now move through all of those that we are going to deal with on this run
$sql = "SELECT * FROM changes WHERE done = 1";
try { $result = D::i()->query($sql); } catch(PDOException $e) { $error = 1; echo "Error"; echo $e->getMessage(); }
 
while($row = $result->fetch())
{
	// Deal with each change
	if($row['changetype'] == 'NEW') // We have a new client
	{
		// Read data about the client from the clients database
		$sql2 = "SELECT * FROM clients WHERE id = '".$row['client']."' LIMIT 1";
		try { $result2 = D::i()->query($sql2); } catch(PDOException $e) { $error = 1; echo "Error"; echo $e->getMessage(); }
 
		while($row2 = $result2->fetch())
		{
			// Use Glide API to create a new client
			$command = "/clients/create";				// The API command that we will be using
			$baseurl = "http://api.whatsglide.com";		// Create the request URL
			$url = $baseurl.$command."?key=".$gkey."&returnFormat=1";	// Build the URL that we will call
 
			$ch = curl_init();									// Initiate curl
			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 	// Disable SSL verification
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			curl_setopt($ch, CURLOPT_URL,$url);					// Set the url that we wish to call
 
			// Now we build up a PHP array with the data for our new client - these are some of the fields that we can supply
			$fields = array();
			$fields['name'] = urlencode($row2['name']);
			$fields['type'] = "1";
			$fields['ucode'] = urlencode($row2['code']);
			$fields['opt_incorpdate'] = urlencode($row2['incorp']);
 
			// Note: You might wish to expand upon this to include other fields, see documentation for all posibilities
 
			// Turn the above array into a string that we can pass as POST fields
			$fields_string = "";
			foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
			$fields_string = rtrim($fields_string, '&');
			curl_setopt($ch,CURLOPT_POST, count($fields));			// Set the cURL options for POST data
			curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
 
			$curl_result = curl_exec($ch);			// Execute our request (call Glide and make our request)
			curl_close($ch);		// Close down cURL - as we have done what we wished to do
 
			$array_result = array();	// PHP array to place our decoded data into
			$array_result = (array)json_decode($curl_result, true);
 
			print_r($array_result);		// For now we will just print out what we have gotten back from Glide
 
			// Now - some data is stored in 'Additional Client Fields', we run additional API calls for this data
 
			// In our example the phone number is stored in a special client field, so we run a seperate API call for that
			// You would repeat this for other fields
			$clientID = $row2['code']; 			// This is the unique client code that you specified at creation
			$fieldID = "220";					// This the database field code for 'Phone 1'
			$value = urlencode($row2['phone']); // This is the data to insert into the field, note we need to use urlencode
 
			$command = "/clients_by_id2/$clientID/set/$fieldID/$value";				// The API command that we will be using
 
			$baseurl = "http://api.whatsglide.com";		// Create the request URL
			$url = $baseurl.$command."?key=".$gkey."&returnFormat=1";	// Build the URL that we will call
 
			$ch2 = curl_init();									// Initiate curl
			curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, false); 	// Disable SSL verification
			curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
			curl_setopt($ch2, CURLOPT_URL,$url);					// Set the url that we wish to call
			curl_setopt($ch2, CURLOPT_HTTPGET, 1);
 
			$curl_result = curl_exec($ch2);			// Execute our request (call Glide and make our request)
			curl_close($ch2);		// Close down cURL - as we have done what we wished to do
 
			$array_result = array();	// PHP array to place our decoded data into
			$array_result = (array)json_decode($curl_result, true);
 
			print_r($array_result);		// For now we will just print out what we have gotten back from Glide
		}
	}
	else if($row['changetype'] == 'EDIT') // Edit a client
	{
		// Read data about the client from the clients database
		$sql2 = "SELECT * FROM clients WHERE id = '".$row['client']."' LIMIT 1";
		try { $result2 = D::i()->query($sql2); } catch(PDOException $e) { $error = 1; echo "Error"; echo $e->getMessage(); }
 
		while($row2 = $result2->fetch())
		{
			$clientID = $row2['code']; 			// This is the unique client code that you specified at creation
 
			$command = "/clients_by_id2/update";				// The API command that we will be using
			$baseurl = "http://api.whatsglide.com";		// Create the request URL
			$url = $baseurl.$command."?key=".$gkey."&returnFormat=1";	// Build the URL that we will call
 
			$ch = curl_init();									// Initiate curl
			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 	// Disable SSL verification
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			curl_setopt($ch, CURLOPT_URL,$url);					// Set the url that we wish to call
 
			// Now we build up a PHP array with the data for our new client - these are the fields that we will supply
			// Note: You may wish to supply more or less data, see the documentation for full details
			$fields = array();
			$fields['name'] = urlencode($row2['name']);
			$fields['ucode'] = urlencode($row2['code']);
			$fields['opt_incorpdate'] = urlencode($row2['incorp']);
 
			// Turn the above array into a string that we can pass as POST fields
			$fields_string = "";
			foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
			$fields_string = rtrim($fields_string, '&');
			curl_setopt($ch,CURLOPT_POST, count($fields));			// Set the cURL options for POST data
			curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
 
			$curl_result = curl_exec($ch);			// Execute our request (call Glide and make our request)
			curl_close($ch);		// Close down cURL - as we have done what we wished to do
 
			$array_result = array();	// PHP array to place our decoded data into
			$array_result = (array)json_decode($curl_result, true);
 
			print_r($array_result);		// For now we will just print out what we have gotten back from Glide
 
 
			// The phone number is stored in a special client field, so we run a seperate API call for that
			$fieldID = "220";					// This the database field code
			$value = urlencode($row2['phone']); // This is the data to insert into the field, note we need to use urlencode
 
			$command = "/clients_by_id2/$clientID/set/$fieldID/$value";				// The API command that we will be using
 
			$baseurl = "http://api.whatsglide.com";		// Create the request URL
			$url = $baseurl.$command."?key=".$gkey."&returnFormat=1";	// Build the URL that we will call
 
			$ch2 = curl_init();									// Initiate curl
			curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, false); 	// Disable SSL verification
			curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
			curl_setopt($ch2, CURLOPT_URL,$url);					// Set the url that we wish to call
			curl_setopt($ch2, CURLOPT_HTTPGET, 1);
 
			$curl_result = curl_exec($ch2);			// Execute our request (call Glide and make our request)
			curl_close($ch2);		// Close down cURL - as we have done what we wished to do
 
			$array_result = array();	// PHP array to place our decoded data into
			$array_result = (array)json_decode($curl_result, true);
 
			print_r($array_result);		// For now we will just print out what we have gotten back from Glide
		}
	}
}
 
// Now finally set all of the change records that we were dealing with to done
$sql = "UPDATE changes SET done = 2 WHERE done = 1";
try { $result = D::i()->query($sql); } catch(PDOException $e) { $error = 1; echo "Error"; echo $e->getMessage(); }
 
?>

 

Explanation

As you can see we check the changes table for entries where done = 0, done is a field that is set to 0 when the row is created, that is when the change to the clients database occurs.

We then set done to equal 1 when we are working on the row, and finally we set it to 2 when we have completed working on the row.

Depending on whether the change was a ‘new’ row or whether it was an ‘edit’ to an existing row we execute different code.

In the case of a new row then we repeat our code from the first example, which connects to Glide and creates a new client. After creating the client we set the phone number, which if you remember is an ‘Additional Field’ in Glide and is set after the initial client creation process has completed.

In the case of an ‘edit’ we make a similar API call, but we supply the unique client code so that Glide can find the client in its client database.

Note: This code is not the ‘id’ field in our clients database, it is the ‘code’ field. Our ‘id’ field is just for our client database, the ‘code’ field is the identifier which is shared across systems. Be careful not to confuse the two.

We loop through every change in the table and contact Glide each time making the relevant API calls. You can test the functionality of the script by running it on your machine, you should find that it creates our client from the trigger test, then updates its phone number. Diligent readers will note that in our edit functionality we actually supply all the data for the client, rather than just what has been updated. We do this as for data of this size there are negligible differences in the time taken to update just the phone number and update all the client. The programming effort required to do the latter would be considerable with no clear benefits.

However, in a situation where your clients have 25+ additional fields for example then it would make sense to develop a system whereby the changes table noted what was changed and only updated the relevant information. Developing such as solution is left to the reader as it is beyond the scope of this tutorial.

Checking For Updates

Our script may have worked correctly, but you will notice that currently we would need to run it manually after each change to the client database. This is impractical and with many users potentially updating the clients database, entirely unacceptable.

Therefore, we need a way to run the above PHP script at regular intervals. The idea is that the script checks the changes table, and if no new changes have been made it closes. On the rare occasions when changes have been made it will spring into life and make the relevant Glide API calls to update the Glide client database to mirror the changes.

The good news is that there is no need to manually run the above script, on both Linux and Windows systems there are tools provided to have the script run at regular intervals.

The computing power needed to check a table for new entries and exit when none are found is minimal, and so you do not need to fear using too many resources with this method.

Utilities for Windows and Linux

On Windows systems you use a utility called ‘Task Scheduler’. You need to enter the full command line to get PHP to execute your script, this may involve entering a longer command than what you have done to this point. It will include the folders detailing the location of PHP, plus the location of your script.

To fully understand the working of ‘Task Scheduler’ I recommend that you do a Google search and read up on the subject.

On Linux systems we use the crontab utility. This is similar to Task Scheduler but is text based.

CronExample

I am running the script every minute, which will mean that on creating a new client on the local database there will a delay of a maximum of 60 seconds before the process to add the client to Glide begins.

You should consider various factors when choosing what frequency to run your update script. If your client database is used by many dozens of people and new clients are added in regular bursts then you may find a frequency of 10 minutes makes more sense. This is because we need to ensure that our update process completes before we run it again. If you are adding 10 new clients and each has 10 Additional Client fields to be updated then that equates to 110 calls to the Glide API. If a call takes half a second due to Internet lag then the entire process will take just short of 60 seconds.

Testing

You can test our solution by logging into Glide and noting the number of clients that you have. Then add a new client our client database and wait roughly 60 seconds for the update script to run. If you have chosen a different frequency then this time period will be different. You should then be able to refresh your Glide client list and see the new client.

Expanding the solution

This basic solution has integrated our simple custom build client database which has fields for name, incorporation date and phone number. In reality you will find most commercial practice management systems store far more data for each client. Please see the Glide API documentation for full specifications of what information you can supply with the initial client creation API call. Further data is supplied in subsequent calls and you may find you require several of these after the initial client creation.

Please do not hesitate to contact us should you have queries regarding the Glide API.

Using Microsoft SQL Server

This tutorial has used the freely available MySQL database server (http://www.mysql.com), to use Microsoft SQL Server you would need to change the db.php file to connect to the relevant MS-SQL database and table. I believe the SQL commands found in the tutorial would work without changes.

Further Information

If you would like to discuss your particular database setup with our technical staff here at Glide please create a support ticket at https://www.whatsglide.com/support/. We would be happy to advise you on the easiest way to integrate Glide with your particular IT setup.

 Source code for this tutorial can be downloaded here:

http://www.whatsglide.com/tutorials/API_Tutorial_1_Code.zip

Leave a Reply

Your email address will not be published. Required fields are marked *