Returns the number and type of form sessions per published formId. This may be used to query the number of active users of all or certain forms over a period of time using the optional to/from parameters. The optional "formIDs" parameter may be used to retrieve statistics only for certain forms - if sessions do not exist for explicitly provided formIDs, 0 will be returned in the map entry.
For example, in the response below there are five "standard" active form sessions and one "longlived" (saved) form session currently active for a published form with the ID 38 between the from and to timestamps.
Parameters
Name | Type | Description |
---|---|---|
formIDs | Array<Long>, optional | Published form IDs. Omit to return al forms |
types | Array<String>, optional | Specify types to return, eg ["standard","longlived"] |
from | ISO Date, optional | Filters the session count from a certain update time |
to | ISO Date, optional | Filters the session count to a certain update time. defaults to "now" if not specified |
Example Request
{
"id": 1,
"method": "getNumFormSessions",
"params": {
"formIDs": [38, 40],
"from": "2015-10-01T14:00:00Z",
"to": "2015-10-01T14:15:00Z"
}
}
Example Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"result": {
"38": {
"standard": 5,
"longlived": 1,
"total": 6
},
"40": {
"standard": 0,
"longlived": 0,
"total": 0
}
}
}
}