Skip to end of metadata
Go to start of metadata

If you are building complex table queries for use in the API, then you may find it easier to build the tables you want in SuperWEB2, and then use the option to download your table as an Open Data API Query.

Simply build the table that you want and then select Open Data API Query from the Download Table drop-down menu:

SuperWEB2 will download a text file containing the JSON query you will need to request the same table from the Open Data API.

For example:

  1. Create your table in SuperWEB2 and select the Open Data API Query (.json) download format:
  2. Click Go.
  3. SuperWEB2 downloads a text file containing the JSON for your query:

    {
        "database": "str:database:bank",
        "measures": ["str:count:bank:F_Customer"],
        "recodes": {
            "str:field:bank:F_Customer:Gender": {
                "map": [["str:value:bank:F_Customer:Gender:C_Gender:M"], ["str:value:bank:F_Customer:Gender:C_Gender:F"], ["str:value:bank:F_Customer:Gender:C_Gender:U"], ["str:value:bank:F_Customer:Gender:C_Gender:-1"]],
                "total": true
            },
            "str:field:bank:F_Customer:Marital_Status": {
                "map": [["str:value:bank:F_Customer:Marital_Status:C_Marital_Status:S"], ["str:value:bank:F_Customer:Marital_Status:C_Marital_Status:M"], ["str:value:bank:F_Customer:Marital_Status:C_Marital_Status:D"], ["str:value:bank:F_Customer:Marital_Status:C_Marital_Status:U"], ["str:value:bank:F_Customer:Marital_Status:C_Marital_Status:-1"]],
                "total": true
            }
        },
        "dimensions": [["str:field:bank:F_Customer:Gender"], ["str:field:bank:F_Customer:Marital_Status"]]
    }
  4. You can now POST this JSON query to the /table endpoint.

Make sure you include your API key in the header and set the Content-Type of the body to application/json.

Limitations of Open Data API Query Downloads

Please note that some features are not supported by the JSON download option.

The following items will not be included in the downloaded JSON query:

  • Derivations
  • Ranges
  • Quantiles
  • User Defined Fields
  • Any settings applied in SuperWEB2 (such as percentages or zero suppression)

Disable Open Data API Query Downloads

The Open Data API download option will be available to all users by default, but if you wish you can disable this by changing the download.enableOpenDataApiQuery property in the configuration.properties file.

  • No labels