Developers LinkApi

Business Intelligence

This guide has the goal of showing you how to make a data integration using LinkApi's platform, so you can have an analytical view of important metrics for your business.

We will use as an example, Bling as our ERP and Pipedrive as our CRM. It's worth mentioning that their documentation will provide information like the API key, authentication type and Base URL.

  • 1.Our first step is building Bling's application in LinkApi's platform. On your Build menu, go to your Catalog view and select New App, so you can start the initial setting of your application:
    1. The second step is about the authentication setting from this API. In Bling's case, they use Querystring auth, as informed by their documentation:
    1. The third step is filling information about the Resources, which are the information we wish to receive from the API. In our example, we will need data about the accounts receivable. On Bling's documentation, they show what endpoint you should choose to get this, which is contasareceber. Having that, fill the fields about the URL and which type of method you need, then click on Add Resource. For our goal, we should use get.
    1. In order to test the application, we must inform the token defined on the authentication tab, so, we insert these credentials clicking on the test button (the "play" sign, or clicking on the message You can add auth params for test).

Our platform links the Base URL in JSON with Bling's API Key. When you test it, you'll find the information presented on arrays level on the lower left side of the page.

It's worth mentioning that in this example, we'll only use our Accounts Receivable resource, but the platform is flexible enough so you can use as much as you need for your projects' goals.

    1. To end the app creation, we'll have to convert our JSON generated code to a table, using the Response tab. On this step, select the field that contains the unique information, which is the ID field on our case. Having that made, just finish it by clicking on Create App.

To create Pipedrive's (or other) application, you should follow the same logic, using their documentation as a reference as well.

With both applications created, the next step is building another application that will serve us as a Data Warehouse, so we can consume data from Bling (accounts receivable) and from Pipedrive (the deals), in a MongoDB database.

    1. Just like the previous steps, you should go to your Catalog view and click on New App and start setting up the database. Note that you have to set the type of application as Database, and specify which one is it:
    1. MongoDB's authentication is uri, by default. So we don't need to change any settings on this tab.

      1. On the Resources tab, we'll specify which data are going to be inserted on the database. On our example, we'll use Pipedrive's deals and the receivables from Bling. For both, we'll use the post action.
      1. MongoDB's authentication is uri, by default. So we don't need to change any settings on this tab.
      1. On the Resources tab, we'll specify which data are going to be inserted on the database. On our example, we'll use Pipedrive's deals and the receivables from Bling. For both, we'll use the post action.

With the three applications created, the next step is creating a new Project, to link the three applications.

    1. On the Build menu, select Projects, then click on New Project. This step requires you to choose which applications are going to be used and a name for your project. You can end this step clicking on save.
    1. Having the project created, now we should set the required automation, that for this example are the deals and the ERP information. On the automation menu, there is an editable example, and we'll use that to configure our first one. We'll name it syncDeals, and it will be the one responsible for fetching deals' data on Pipedrive.

To configure it, you can use the code snippet that's in the lower left menu, and paste it below the indicated line (your beautiful code hoes here).

    1. Still in syncDeals automation, we now have to iterate the results and insert them in MongoDB. On the snippets menu (upper right of your screen), select the *Parallel function and paste the snippet below the previous one.

It's important to be aware of the applications particularities for each one of them. For Bling's information, the id is a propriety within the entity for Accounts Receivable. Therefore, we'll need to specify the uniqueKey as contaReceber.id

With the automation built and set, save the project and proceed to the triggers creation.

    1. For the goal we have, we need to set up two different triggers - one for the deals and another one for the accounts. Remember to set the triggers frequency. In our example, we'll activate it every 12 hours.
    1. Select which type of trigger you will build, in our case, it is a pooling type.
      If you want to make some tests before, you can leave the trigger deactivated for now.

With all the configuration done, we can start the sync process to MongoDB. Activate the triggers execution, and if needed, check the generated activity logs. With that, your database should already receive the desired data, and Metabase will be updated.

Business Intelligence


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.