Example Request

The following is an example request of a date range report with no global filters and 1 segmentation level showing only the number of active users using each different product language. In this example, we are assuming that cookie-based authentication is being used, and therefore, the user and sessionId properties are not being used. Also, we are requesting a HighCharts column chart by adding the following parameters to the URL: &resultFormat=highcharts&hcType=column 

The following is the JSON object which is to be sent, regardless of whether this is a GET or POST request:

{

    "productId": 2376158762,

    "startDate": "NOW-60",

    "dateSplit": null,

    "clientStatus": [

        "active"

    ],

    "levels": {

        "level1": {

            "property": "prodLanguage",

            "segments": [

                {

                    "type": "regex",

                    "value": ".*"

                    "split": true

                }

            ]

        }

    }

}

The following is how the request URL should look with URL encoding:

https://api.revulytics.com/reporting/generic/current?query=%7B%22productId%22%3A2376158762%2C%22startDate%22%3A%22NOW-60%22%2C%22dateSplit%22%3Anull%2C%22clientStatus%22%3A%5B%22active%22%5D%2C%22levels%22%3A%7B%22level1%22%3A%7B%22property%22%3A%22prodLanguage%22%2C%22segments%22%3A%5B%7B%22type%22%3A%22regex%22%2C%22value%22%3A%22.*%22%2C%22split%22%3Atrue%7D%5D%7D%7D%7D&resultFormat=highcharts&hcType=column

To better understand the above example, the following is the same URL without using URL encoding:

https://api.revulytics.com/reporting/generic/current?query={"productId":2376158762,"startDate":"NOW-60","dateSplit":null,"clientStatus":["active"],"levels":{"level1":{"property":"prodLanguage","segments":[{"type":"regex","value":".*","split":true}]}}}&resultFormat=highcharts&hcType=column