Toggle menu

getNumFormSessions

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

NameTypeDescription
formIDsArray<Long>, optionalPublished form IDs. Omit to return al forms
typesArray<String>, optionalSpecify types to return, eg ["standard","longlived"]
fromISO Date, optionalFilters the session count from a certain update time
toISO Date, optionalFilters 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
            }
        }
    }
}

Last modified on June 27, 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon