JSON manifest

A report plugin uses an input JSON manifest file. To get your JSON manifest for local development, you need the Project key and Dataset key from section 3, and supply them with in GET request to https://www.stormly.com/api/developer/get_manifest, using two headers: X-Project-Key and X-Dataset-Key. For example with curl:

curl "https://www.stormly.com/api/developer/get_manifest" \
-H 'X-Project-Key: abcd12345' \
-H 'X-Dataset-Key: abcdefghjklm12346789'

This is what your JSON manifest could look like:

{
"dataUrl": "https://data.stormly.com/api/plugin/query_manifest/abcdef123456",
"downloadUrl": "https://s3.eu-central-1.amazonaws.com/storage.stormly.com/abcd/1234",
"getUploadUrl": "https://www.stormly.com/api/developer/upload_url/abcd/1234",
"inputData": {
"forecast_value": {
"type": "number",
"valueIndex": 0
}
},
"inputParams": {
"forecast_periods": 7.0
}
}

The object under inputParams maps 1-to-1 with any simple plugin input variables earlier. In our example we have a forecasting plugin, and we want the end-user to enter a number of periods — in this case days as we have a report time unit of days.
If an optional plugin question is not assigned by the end-user, it will not be in the inputParams in the JSON manifest at all, so be sure to always check if the key exists.
Note that any numeric values will always be represented as float, so make to sure cast to integer when you pass it on to other libraries that expect integer input only.

The dataUrl can be called as-is, and returns a JSON containing all data for the report the plugin is being run on. The downloadUrl and getUploadUrl keys are not used in report plugins.

The inputData is the actual input data value index that we want to use, as chosen by the end-user or supplied by the Insight API when running a plugin. If the end-user runs a funnel report for example, the report has a few value indexes, one for each funnel step, conversion time, etc. Because we defined a plugin data input variable of type number earlier, we can use any numeric value the report returns. In this case the end-user chose the first report value, as valueIndex is 0. This valueIndex maps directly to the actual report data — each item has a values key, and the valueIndex is the array index of those values. See the next section for more details on the data format.

Similarly to valueIndex we can have a {"type": "text", "groupByIndex": 0}, which indicates the relative group-by index values, where indexing is based on the groupBy key in the data context object.