Building Databox Connector for Magento 2

 
Databox Magento 2 Integration

Magento 2 Connector for Databox

Building Databox Connector for Magento 2

Last month a client approached us to build Analytics Dashboard for his business where he can track performance and discover insights in real-time. He was primarily using Magento 2 and some other tools like Zapier, Google Analytics, Facebook Ads etc. After some research, we landed to a mobile-first business analytics platform called Databox, where you can connect various data sources and can track all of your business KPIs in one place. It sounded a great option and so we decided to build a Magento 2 connector for Databox. As Databox platform is still evolving so we faced many challenges but ultimately our team was able to successfully build and release the BETA version of the Magento connector. You can check the released BETA version of the Connector at Databox official integration page here

As sometimes the official documentation available at Databox may not be sufficient, so this knowledge base article will be a starting point for someone who want to build connectors in Databox platform. Though we have developed a Magento connector but the same knowledge can be used to develop any new connector for any other platforms also.

Metrics

The first step in building a Databox connector is to identify the metrics which you want to display in your Dashboard. In our case, we wanted to display important store metrics like Total Sales, Average Sales, Pending Orders, Low Stock Products etc. Since Databox connector will fetch these details from our Magento store so we need to have corresponding APIs at Magento side to provide details to Databox.


Authentication

The second most important thing is to identify what kind of authentication you want to use for Databox? You need to check which authentication is supported by your platform (Magento 2) and then have to choose accordingly. There are mainly three basic authentication supported by Databox :

1) Oauth based authentication
2) Token based authentication
3) Basic authentication


Development Modules

There are mainly two development modules in Databox. They are listed below :

A) Manifest: This is a YML configuration file in which you can mention configuration regarding APIs, metric info, task to get metrics through API and various other information.

B) Transformation Logic: This is basically a PHP class in which you can access data available from tasks. You can modify and arrange it to produce final data that will be accessible at Dashboard (Databoard) using logic here.

Please note that you have access to data available through tasks and after it has been refined by transformation in the 'Run Tasks' and 'Run Transformations' consoles respectively.

Also, you will require some basic knowledge of JMESPATH transforms, as it will be used to filter data from tasks itself. You can find some tutorials from http://jmespath.org/tutorial.html. The tutorials available there are more than enough to start.


Additional Documentation (Not available at Databox)

Most of the documentation you will require is available at Databox as their official documentation at http://databox.github.io/connectors/

However, the documentation at some places is old, missing or confusing. So, we decided to write our next article to add the missing parts in Databox's official documentation for helping other fellow developers. Here is the link to the missing Databox documentation for building connectors.

Please feel free to contact us if you want to build a new integration for Databox.
DO YOU NEED NEW DATABOX INTEGRATION?
Fill this form to get free quote.