This web service responds with the number of sessions per device type on a portal over a period of time.
Method | Endpoint |
---|---|
POST |
|
Request example
The following lines show an example of a JSON request body:
{
"startDate": "2024-01-01",
"endDate": "2024-05-01",
"groupByPeriod": "month",
"filters": {
"deviceType": ["mobile", "tablet", "desktop"]
}
}
Field | Type | Required? | Description |
---|---|---|---|
startDate |
String | Yes | The inclusive start date of the period. Must be 2023-12-13 at the earliest when grouping by day. Must be 2023-12-18 at the earliest when grouping by week. Must be 2024-01-01 at the earliest when grouping by month. |
endDate |
String | Yes | The exclusive end date of the period. Must be later than the start date. Must be 2023-12-14 at the earliest when grouping by day. Must be 2023-12-25 at the earliest when grouping by week. Must be 2024-02-01 at the earliest when grouping by month. |
groupByPeriod |
String | Yes | The period by which to group the events. Valid values are day , week , and month . |
filters |
Object | No | An optional field to filter results. If this field is absent or undefined, the web service returns data for all types. |
deviceType |
Array | No | The device types. Valid values are mobile , tablet , and desktop . |
Response body
The following lines show an example of the JSON response body:
{
"startDate": "2024-01-01",
"endDate": "2024-05-01",
"groupByPeriod": "month",
"results": [
{
"device": "mobile",
"periods": [
{
"periodStartDate": "2024-01-01",
"periodEndDate": "2024-02-01",
"count": 102
},
{
"periodStartDate": "2024-02-01",
"periodEndDate": "2024-03-01",
"count": 180
},
{
"periodStartDate": "2024-03-01",
"periodEndDate": "2024-04-01",
"count": 2206
},
{
"periodStartDate": "2024-04-01",
"periodEndDate": "2024-05-01",
"count": 103
}
]
},
{
"device": "tablet",
"periods": [
{
"periodStartDate": "2024-01-01",
"periodEndDate": "2024-02-01",
"count": 497
},
{
"periodStartDate": "2024-02-01",
"periodEndDate": "2024-03-01",
"count": 337
},
{
"periodStartDate": "2024-03-01",
"periodEndDate": "2024-04-01",
"count": 336
},
{
"periodStartDate": "2024-04-01",
"periodEndDate": "2024-05-01",
"count": 426
}
]
},
{
"device": "desktop",
"periods": [
{
"periodStartDate": "2024-01-01",
"periodEndDate": "2024-02-01",
"count": 2812
},
{
"periodStartDate": "2024-02-01",
"periodEndDate": "2024-03-01",
"count": 2587
},
{
"periodStartDate": "2024-03-01",
"periodEndDate": "2024-04-01",
"count": 2702
},
{
"periodStartDate": "2024-04-01",
"periodEndDate": "2024-05-01",
"count": 3060
}
]
}
]
}
Field | Type | Description |
---|---|---|
startDate |
String | The inclusive start date of the period. |
endDate |
String | The exclusive end date of the period. |
groupByPeriod |
String | The period by which to group the events. |
results |
Array | An array containing the results for all device types. |
device |
String | A device type. |
periods |
Array | All days, weeks, or months between the start date and end date for a given device type, and grouping period. |
periodStartDate |
String | The inclusive start date of a period for a given device type. |
periodEndDate |
String | The exclusive start date of a period for a given device type. |
count |
Number | The number of sessions for the selected devices in a given period. |
Return code | Description |
---|---|
200 OK |
Returns data in JSON format. |