Frontaccounting SimpleAPI Module guide
Frontaccounting SimpleAPI Module guide is one of a good way to integrate your products lists from your Frontaccounting to Your eCommerce Store. Here is an simple Helping tutorial to install SimpleAPI on your FA and which will be accessed from remote. Let’s start integration.
First get a copy of SimplAPI module from the Author “Andrés Amaya Díaz “. Here is the link to get the zip of the SimpleAPI module.
And now goto your installed Frontaccoutning directory and open “modules/ ” and extract the zip into it. Than rename the Extracted folder name “FrontAccountingSimpleAPI-master ” into your desired name ” here i just renamed it as ” kvcodes ” . Than move to your browser and goto Install Extension in the Setup page .
Now, it will appear in the list, just install it, and you have one more important work here. Goto your modules directory and open your SimpleAPI module folder than find, util.php and open it on text editor, and here, you need to change the company name, user name and password with your Working FA details and Save it.
$company = '0'; // Company extension, you gave it while creating company $user = 'kvcodes'; // username $password = 'login_password'; //password
and open your browser and open
http://your-fa-url/modules/kvcodes/. This is the testing url. if you encounter any error than it will be the problem of Slim framework or you gave wrong login credentials,
Now, we need to test the API on Remote Server, The following code helps you to test it on remote.
<?php $action = 'customers'; $headers = array('X_company: 0', 'X_user: admin', 'X_password: 123456'); $url = "http://www.your-fa-installation.com/modules/kvcodes/$action/"; // create a new cURL for data retrieval $ch = curl_init(); curl_setopt($ch,CURLOPT_HTTPHEADER,$headers); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); ob_start(); curl_exec($ch); $content = ob_get_contents(); ob_end_clean(); curl_close($ch); echo print_r(json_decode($content, true), true); ?>
This will list you the JSON encoded Customer list gathered from the customers table,