You are here: Home / Documentation / 6. Add-ins / 6.9 Integration With Leady.com / Integration With Leady API

Integration With Leady API

Integration is provided based on separate application that communicates with Leady API and eWay-CRM API. Data are moving from Leady API to the separate application where are processed and moved to eWay-CRM API and then to eWay-CRM database.

Requirements

Clients PC must meet same requirements same as server part of eWay-CRM:

  • Windows Server 2003 or Windows Server 2008
  • Internet Information Services (IIS) 6.0 or higher
  • Microsoft SQL Server 2014
  • Microsoft .NET Framework 4.0 or higher

Important Before Integration Deploy

You need to be sure that there is LeadyComId custom field on journal. We can run script on server that creates it.

There should be Leady category in eWay-CRM.

Then, you need to set correct values into App.config file.

<leadyConnection
      url="https://api.leady.com/v1"    - Address remains same
      userName=" "                      - Username to Leady.com
      password=" "                      - Password to Leady.com
      spentSecondsThreshold=" "         - Minimal number of seconds visitor spends on web page to make a record
      periodStart=" "                   - Since what time records will be calculated
      />
<eWayCRMConnection
      url=" "                           - URL of Web Service
      userName=" "                      - Username to eWay-CRM
      password=" "                      - Password to eWay-CRM
      journalType =" "                  - GUID of visit type journal
      groupLeady =" "                   - GUID of "Leady" group
      countryEnumType =" "              - GUID of Drop Down Menu for Countries
      leadyIdField =" "                 - Name of LeadyIdField custom field, eWay-CRM uses custom field LeadyComId (database name)
      />

If you set new values into App.config file, you need to make new build. After that, you can deploy integration.

Integration Process

Deploy is in the form of application file in the folder where eWay-CRM is installed and in the form of trigger in the triggers folder.

1) Activation

It is activated by standard XML trigger that is proceeded every hour since 00:40 AM. Length of the interval and start time can be customized to client needs.

2) Check of First Launch

After start, the application runs a check of first launch. the check is based on the FirstRunCheck.txt file that is placed in same folder as application. If the file is empty, the new launch is first start. If application was already running, there is Yes text in the file. The first launch can be set manually - just by delete of the TXT file. Check of first launch allows the application to load data older than your set interval. In App.config file, you can set the date from what data should be loaded - you can do it before the application deploy.

After each other launch, interval is set to 24 hours back from the current time.

3) Load of Visit

After the check of first launch, application contacts Leady API to load required data. Communication proceeds via command in the form of URL address. The base of command is same (https://api.leady.com/v1/) and after this, there can be functions that are supported by API - it is activity on web in our case.

This picture shows data of one visit:

4) Load of Company

In a similar way, the application asks eWay-CRM API for the list of companies. eWay-CRM API is described here: https://github.com/rstefko/eway-crm-php-lib .

5) Company Pairing

Now, application walks through the list of visits (you can set the minimal length of visit in App.config). The key for the record is regno - if it is missing, the record is skipped. If regno is filled, application checks whether there is company with fitting IdentificationNumber. If there is more than one company, application works with the one that was created first.

Application is able to pair even records where is difference between regno and IdentificationNumber only in the null at the beginning (e.g. 1 = 01).

6) Journal Creating

If there is company where regno is same as IdentificationNumber, new company is not created. If there is no pair, new company is created with data from Leady API. Next steps are same for new or existing company.

Company is related to Leady category (GROUP relation).

Journal with Visit subject is created with relation to the company and detail of visit in the Note. You can see start and end of visit, number of visited pages and other information.

Each record from Leady API ins transformed to journal.

Log File

In the same folder as application is, there is Log folder with Log.txt file in it. You can find here Start and End date and time for each run of the application. If Start is missing, no function run in application. If End is missing, application stopped during its run, or it is still running.

Log file also records exceptions.