Reporting protocol

Users of your apps can email reports containing app data to you. They can also send data to a variety of third-party services, including Google Sheets, various databases, Slack, Wordpress and Salesforce. Third-party services are enabled through a third-party platform like Zapier and Zoho Flow.

You can also send data to a server you run yourself. This is an advanced feature, which requires you to operate a server and write the software which accepts the data sent by the app (or have someone write the software for you). This page describes, in technical terms, the steps you need to take to enable your server to receive data sent from an app built with Calcapp.

Data is sent through either a server relay button or through the RELAY function.

Technical information on the transmitted data

Data is sent over HTTP using the POST request method. You need to configure an HTTP endpoint on your server and enter its address in the Server address field. We highly recommend that you use an HTTPS endpoint to ensure that the data is not intercepted by a third party while in transit.

The data is sent as JSON data. This data consists of an object with a single key, named values. The corresponding value is a JSON object with one key for every form screen that is part of the collected data. Every form screen key is associated with an object representing the collected values in the form of an object. This innermost object has a key for every field.

Calcapp numbers map to JSON numbers, text strings map to JSON strings and logical values map to JSON boolean values.

Form screen labels and field labels are used for the keys, if possible. If a form screen has no title or a field has no label, its name is used instead. All keys belonging to the same object are unique — a serial number in parentheses is appended if there is a name conflict.

Dates are numbers and use the same format used by popular spreadsheets.

Here’s an example mirroring the examples given in the reporting guide:

{
  "values": {
    "Unit conversion": {
      "Enter a length": 52,
      "Result": 20.472440944882,
      "Enter a volume": 6.3,
      "Result (2)": 213.02834301
    },
    "Break-even analysis": {
      "Fixed cost": 600000,
      "Cost per unit": 125,
      "Price per unit": 265,
      "How many?": 4286
    },
    "°F to °C": {
      "Enter temperature": 32,
      "Result": 0
    },
    "°C to °F": {
      "Enter temperature": 0,
      "Result": 32
    }
  }
}