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. The application itself requires Microsoft .NET Framework 4.5.2 or higher.

Important Before Integration Deploy

Contact eWay-CRM technical support for deployment.

Application supports the following configuration options in LeadyConnector.exe.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 (YYYY-MM-DD format)
      />
<eWayCRMConnection
     url=""                          - URL of Web Service
     userName=""                     - Username of API user in eWay-CRM
     password=""                     - Encrypted password. Use HashPassword application in the bin folder of web service to
- encrypt the password.
     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)
     leadyRegNoField="" - Name of the field on Journal for company registration number
      />

Integration Process

Application is deployed into .\bin\LeadyConnector directory. Also there is a new trigger file created in 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 or does not exist, current launch is a first start. If application was already running, there is Yes text in the file. The first launch can be set manually - just delete the file. Check of first launch allows the application to load data older than your set interval. In LeadyConnector.exe.config file, you can set the date from what data should be loaded.

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 LeadyConnector.exe.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 is transformed to journal.

Log File

In the Log folder the is LeadyConnector.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.