Document toolboxDocument toolbox

Support center for flex.bi version 3.2

REST API connection (HansaWorld)

Things you should know about REST API data upload :

REST API  requires :

  •  HansaWorld version STDERP_8.1-2015-06-02 or later
  •  HansaWorld Webshop licence enabled for setup period

Please note : 

  • Currently Hansaworld Rest API connection pushes all data that is requested starting form period you want to start import from
  • Rest API currently can be as only data import option - it can not be mixed with Source files data upload. If rest appi connection suits only some of your imports (too much data in selected period, for example), you should  setup HAL package for automated File export / import in your Flex.bi account or choose manual File upload with HansaWorld Exports.

Prepare your acount for REST API connection

To be able to use REST API as a way to import your files you must first make sure you have the necessary plan parameters enabled:

  1. If you have your Flex.bi on our provided Cloud server, you will have to contact flex.bi support who will open  REST API for you. Contact : support@flex.bi
  2. If you have a Private Flex.bi server then you will have to manually add the following Plan parameters in your account settings:

    [hansaworld]
    data_source = "rest_api"
    batch_days = 10

HansaWorld setup for Rest api exports

  1. You need to know the web port of your HansaWorld server (which is not the same as you normal port used for HansaWorld client). Normally it should be specified in Technics>>Program Mode.

    As web port can be overridden by server startup scripts, firewall or other configurations we recommend to contact your HansaWorld partner and/or hosting partner to find out the actual port number used

     

  2. You need to know the URL or IP address of your HansaWorld server that can be used for web requests from the Internet.
  3. Add new row in Webshop>>Settings>>Allow functions on web>>WebDataAPI (you can restrict the usage of this by specifying allowed ip addresses)
     
  4. Test in your browser or other software designed for REST API request testing that this functionality is working with URL
    http://ip:port/WebDataAPI.hal?register=BaseCurBlock

As a result you should get a short JSON formatted result with your base currencies from first company which means connection is working and flex.bi will care of the rest

We suggest that you discuss security measures with your HansaWorld or hosting partner to ensure that data access is secured only for flex.bi

Setting up Rest api connection in Flex.bi

To do an import click on the "Add new source application" button in your Source Data -> Source Applications tab. Select "HANSAWORLD" as your source application.

REST API currently only supports the full import of registers (or from the specified import date, specific user defined intervals are available currently).

If you choose to use REST API as the main method of importing data into flex.bi you will not be able to use any other file import methods from HansaWorld


Press the button create.

A page similar to this should appear

In the source data URL enter the URL to your HansaWorld server. The URL should look similar to this: http://sample.url.com:1234/WebDataAPI.hal

The URL consists of the following elements

Public HostnamePort (HTTP)

.hal file name

Optional fields
http://sample.url.com:1234/WebDataAPI.hal?company= *number*

         -where *number* is the number (code) of the company that's displayed in System (Module) -> Registers -> Companies. Adding this optional field will export data only from that specific company. If this part of the URL is not specified then REST API will import data from the first company in the list

When you have entered your Source data URL then press continue.

In the next window you will see the following data fields.

Three new data entry fields have appeared just for REST API - "Start import from", "Regular import frequency" and "Date format".

In the "Start import from" you have to enter the date in the following format (yyyy-mm-dd). The date describes the point in time from which the data will be imported, that is to say if you enter 2016-01-01 then all data that has been created from 2016-01-01 and onward will be imported, data created before 2016-01-01 will not be imported.

This date cannot be moved to an older date once data has been imported. To move the date back to an older date you will have to delete the cube and re-import the data.

If you do not enter a date, data from 365 days ago will be imported by default.

From the "Regular import frequency" drop down menu you have to select the frequency with which you would like to import your data. Take into account that REST API will import all the data that is from the amount of days in the past from today specified by the "batch_days" parameter in the past. That is, if batch_days = 5 REST_API will import all the data created in the last 5. If batch days is not specified then REST API will by default import data created in the last 10 days.

The "Date format" drop down list is very important to get correct, because it will tell REST API how to properly interpret the dates in your files, if this field is incorrect your data will import incorrectly or not at all. To find out what your date format is in HansaWorld go to "System" -> "Settings" -> "Company Date and Numeric Format"  and see which one of the drop down options corresponds to your data.

Once you are done with selecting everything you wish to import press the "Import" button and the import will begin. Importing with REST API does not upload any source files into the "Source files" section of flex.bi.