Report APIs

Created: - Updated:

This article covers these topics:

Introduction to report APIs

Lumi Say report APIs can be used to automate the transmission of survey data from the Lumi Say dashboard to a remote server. Lumi Say provides two types of APIs:

  • Pull APIs: used to fetch survey data at regular intervals from a remote server
  • Push APIs: used to automatically transmit survey data to a remote server when new entries are available

Pulling response data from a remote server

The Lumi Say report service is a web service for fetching Say answer data via a HTTP POST request. Essentially, the service can be used to automate syncing of data between the Lumi Say back-end and any other back-end. The report is requested via a HTTP POST request, and with the correct parameters, a CSV report is returned.

POSTS are directed to the Lumi Say server of your own project using a URL with the following format:


Which will redirect the api call to the correct project. When using the Data API, your current web session is terminated in order to login using the credentials used as parameters in the api call, so don't be alarmed if you are forcefully logged out from the back-end while you are using the data API.

For unix users (for instance mac), you can use the curl command to get the report/images folder:

curl --data "user_name=<username>&password=<password>&survey_id=<survey_id>&report_id=<report id>&report_format=<report_format>"https://<branded_instance><project_name>/pn/lumicompass/api/get_data

URL parameters


The fist word of your Dashboard URL, e.g. "dashboard"


You can find this at the top right corner of your dashboad, please note this field is case sensitive

Request API

The POST should contain the following parameters:

Required parameters

Parameter name Description Values

A back-end user with permissions and company that allows access to the report

your Dashboard username


A correct password for the user, so we can authenticate

your Dashboard password


The numeric id of the survey

can be found by hovering on the survey


The numeric id of the report we want to request, not required for images_zip

in the Report tab of the survey

Optional parameters

Parameter name Description Values

Only answers stored after this time will be included.

A GMT timestamp, in format dd.MM.yyyy HH:mm:ss


Only answers stored on or before this time will be included.

A GMT timestamp, in format dd.MM.yyyy HH:mm:ss


Used to set a different format than CSV for the returned report

csv, sav, images_zip (defaults to csv)

Return values




The requested report file will be returned (CSV/zip folder of images/SAV)

Failure: Authentification failure

The user_name/password combo was invalid, or the user could otherwise not be authenticated

Failure: Survey not found

No survey with id survey_id could be found in the project that the user has access to

Failure: Report not found

No report with id report_id could be found for this survey

Failure: Missing required parameter code:x

One of the required parameters was missing; codes correspond to:
1 - user_name
2 - password
3 - survey_id
4 - report_id
5 - the report does not include CSV format

Failure: No photos found for survey

Report format is images_zip, but no images were found for this survey

Failure: Unexpected exception

General purpose failure, caused by exceptions during report generation


In order to test the pull API you can add the following HTML code to the source of your HTML page and change the action URL to your project URL:

<form id="apitest_form" name="apitest_form" method="POST" action="https://<branded_instance><project_name>/pn/lumicompass/api/get_data">







   <tr><td>user_name:</td><td><input type="text" name="user_name" value=""/></td></tr>

   <tr><td>password:</td><td><input type="text" name="password" value=""/></td></tr>

   <tr><td>survey_id:</td><td><input type="text" name="survey_id" value=""/></td></tr>

   <tr><td>report_id:</td><td><input type="text" name="report_id" value=""/></td></tr>

   <tr><td>start_time:</td><td><input type="text" name="start_time" value=""/></td></tr>

   <tr><td>end_time:</td><td><input type="text" name="end_time" value=""/></td></tr>

   <tr><td>report_format:</td><td><input type="text" name="report_format" value=""/></td></tr>




 <input type="submit" name="s" value="Test!" class="apitest_button"/>


The previous HTML code will create a Data API User Interface looking like this, where you can type in the fields (the same parameters explained above)

Pushing response data to a remote server

To push the data of your project to a remote server, you need to specify the server URL in the designated field when you Creating reports. The URL should be valid and it is highly recommended that a secure connection via HTTPS is used.

The data can be pushed in .csv format or JSON format. You can push the data to many remote servers by creating multiple reports and set a different URL in each report. Always make sure you are NOT including media files.

JSON Structure


    {"id":"3173","name":"JSON structure"},




            "label":"Entry ID",





            "label":"Entry Type",










            "label":"Upload time",





            "label":"Start time",





            "label":"End time",





            "label":"Device Timezone",





            "label":"Device Timezone offset",




            "label":"Survey revision",





            "label":"Survey wave",





            "label":"Length (sec)",





            "label":"Entry location",





            "label":"Raw location data",









            "label":"Geo-fence name",





            "label":"Trigger location latitude",





            "label":"Trigger location longitude",





            "label":"Trigger location accuracy",





            "label":"App version",





            "label":"OS name",





            "label":"OS version",





            "label":"Device make",





            "label":"Device model",





            "label":"Device type",






            "questionText":"this is an info screen",





            "questionText":"Single Choice",



                [{"code":"1","label":"choice 1"},

                {"code":"2","label":"choice 2"},

                {"code":"3","label":"choice 3"},

                {"code":"4","label":"choice 4"}]}},






                [{"code":"1","label":"choice 1"},

                {"code":"2","label":"choice 2"},

                {"code":"3","label":"choice 3"},

                {"code":"4","label":"choice 4"}]}},







                [{"code":"1","label":"choice 1"},

                {"code":"2","label":"choice 2"},

                {"code":"3","label":"choice 3"},

                {"code":"4","label":"choice 4"},

                {"code":"5","label":"choice 5"},

                {"code":"6","label":"choice 6"},

                {"code":"7","label":"choice 7"},

                {"code":"8","label":"choice 8"},

                {"code":"9","label":"choice 9"},

                {"code":"10","label":"choice 10"}]}},







                [{"code":"1","label":"choice 1"},

                {"code":"2","label":"choice 2"},

                {"code":"3","label":"choice 3"},

                {"code":"4","label":"choice 4"}]}},




            "questionText":"Open text question",





            "questionText":"Open Numeric question",





            "questionText":"Multiple Text",



                [{"code":"1","label":"field 1"},

                {"code":"2","label":"field 2"},

                {"code":"3","label":"field 3"}]}},




            "questionText":"Multiple Numeric",



                [{"code":"1","label":"field 1"},

                {"code":"2","label":"field 2"},

                {"code":"3","label":"field 3"},





            "questionText":"Date/Time question",





            "questionText":"Capture an image",





            "questionText":"Record a video",















                "name":"Loop 1",











            "name":"piped loop",










            "questionText":"Piped from Multi choice question $answer(Q3)?",



                [{"code":"1","label":"choice 1"},

                {"code":"2","label":"choice 2"},

                {"code":"3","label":"choice 3"},

                {"code":"4","label":"choice 4"}]






























                {"id":"m24","value":"Apple iPhone5,2"},


                {"id":"2","value":"choice 3"},

                {"id":"3","value":["0","choice 2","choice 4"]},

                {"id":"4","value":"choice 5"},


                {"id":"6","value":"Hello world!"},


                {"id":"8","value":["Answer 1","Answer 2","Answer 3"]},












                            [{"id":"2","value":"choice 2"}]},



                                        [{"id":"4","value":"choice 4"}]






API Settings

Below are dashboard settings.

Attribute nameType DescriptionDefault value
remoter_server_disabled boolean Disables checking of remote server data, so no more data is being sent. false
remoter_server_timer long Sets how often the server checks for data to send. 1 minute
remote_server_batch_size int Sets the size of the batches being sent to remote server, as in how many entries per report being sent. 1 entry
remote_server_batch_timeout long Sets the timeout per batch, as in the timeout of the connection and sending of data to the remote server. 5 seconds
remote_server_blacklist_time long Sets how long a server is blacklisted when a connection fails/timeouts. 10 minutes

How it works (with default values)

When you create a report and set the remote server URL, the API creates a separate table in the database for the entries recorded for this project. The new table has only the answers you are including in this report (Questions included in the created report). The API monitors this table and polls for updates every 1 minute (default value) and it uses HTTP POST to push one entry at a time to the remote server in the selected format.

For security reasons, each HTTP POST has a timeout of 5 seconds when the connection to the remote server fails, after which the specified server will be blacklisted for 10 minutes. This prevents the API from getting stuck trying to connect. Once the 10 minutes have passed the API will try to reconnect to the specified server and POST data again.

How to use this API

The JSON API helps you stream the data as it is received (with latency of 1 minute, depending on the value of remoter_server_timer), the receiving server should be prepared to handle this data as it comes. We recommend a secure connection (HTTPS) on the receiving server and storing mechanism (e.g. disk storage). This means you are building your own database with the entries coming from your Lumi Say instance, and your system will be mimicking real-time streaming (with 1 minute latency).

With the nature of JSON format, you are free to utilize the data as you wish. However, you have to consider the identification of the different variables in the report (refer to JSON Structure).

If you are only interested in having the report in JSON format without regard to the streaming concept, once the data is collected (project is complete), generate a report without the media files (do not include images) and click the following link after customizing it:


This will download the current report in JSON format.

The customizable variables shown in the link in the format: <variable_name>, are detailed in the table below

<branded_instance> the name of your instance, present in your dashboard URL e.g. dashboard in:
<project_name> the name of the project, present in your dashboard URL while on the Home page (Project view) e.g. lumi_compass in:
<survey_id> the id of your survey, can be seen in the Survey view
<report_id> the id of the report that you have created (and maybe customized)

Changing Default Settings

Since the API settings are generic, it applies to all projects on your dashboard.   Any change request will have to go through the Admin of the instance. Changes can only be made with the instance update (every 3 months).