Set

Function

This API is used to set AI > Cross Counting Scenario > Statistics configuration parameters.

Request Message

Parameter Description

Table 1

ParameterRangeTypeDescription
ChannelsInt arrayQuery channel, when querying group, pass empty
GroupsInt arrayQuery group, pass null when querying channel
Date10stringquery date
ReportType"Day","Week","Month","Year"stringquery type
ChnObjType0~2Int arrayDetection type: (Only pass empty when querying groups, corresponding to Channels)
0:"Motion", 1:"Person", 2:"Vehicle"
GrpObjType0~2Int arrayDetection type: (Only pass empty when querying the channel, corresponding to Groups)
0:"Motion", 1:"Person", 2:"Vehicle"

Sample:

POST /API/AI/Scenario/CC/Statistics/Set HTTP/1.1
{
    "version": "1.0",
    "data": {
        "Channels": [
            0,
            3
        ],
        "Groups": [],
        "Date": "2021-01-14",
        "ReportType": "Week",
        "ChnObjType": [
            1,
            1
        ],
        "GrpObjType": []
    }
}

Response Message

Parameter Description

Table 2

ParameterRangeTypeDescription
ChannelsObject arraychannel statistics
JSON show as follow Table 3
GroupsObject arraygroup statistics
JSON show as follow Table 4

Table 3

ParameterRangeTypeDescription
ChnIdintchannel number
NumObject arrayStatistical data
JSON show as follow Table 5

Table 4

ParameterRangeTypeDescription
GroupIdintgroup ID
NumObject arrayStatistical data
JSON show as follow Table 5

Table 5

ParameterRangeTypeDescription
EnterCntintNumber of people entering
ExitCntintnumber of people leaving
StayCntintnumber of people staying

Sample:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "result": "success",
    "data": {
        "Channels": [
            {
                "ChnId": 0,
                "Num": [
                    {
                        "EnterCnt": 0,
                        "ExitCnt": 0,
                        "StayCnt": 0
                    },
                    {
                        "EnterCnt": 0,
                        "ExitCnt": 0,
                        "StayCnt": 0
                    },
                    {
                        "EnterCnt": 0,
                        "ExitCnt": 0,
                        "StayCnt": 0
                    },
                    {
                        "EnterCnt": 11,
                        "ExitCnt": 3,
                        "StayCnt": 8
                    },
                    {
                        "EnterCnt": 16,
                        "ExitCnt": 2,
                        "StayCnt": 14
                    },
                    {
                        "EnterCnt": 0,
                        "ExitCnt": 0,
                        "StayCnt": 0
                    },
                    {
                        "EnterCnt": 0,
                        "ExitCnt": 0,
                        "StayCnt": 0
                    }
                ]
            },
            {
                "ChnId": 3,
                "Num": [
                    {
                        "EnterCnt": 0,
                        "ExitCnt": 0,
                        "StayCnt": 0
                    },
                    {
                        "EnterCnt": 0,
                        "ExitCnt": 0,
                        "StayCnt": 0
                    },
                    {
                        "EnterCnt": 0,
                        "ExitCnt": 0,
                        "StayCnt": 0
                    },
                    {
                        "EnterCnt": 0,
                        "ExitCnt": 0,
                        "StayCnt": 0
                    },
                    {
                        "EnterCnt": 1,
                        "ExitCnt": 0,
                        "StayCnt": 1
                    },
                    {
                        "EnterCnt": 0,
                        "ExitCnt": 0,
                        "StayCnt": 0
                    },
                    {
                        "EnterCnt": 0,
                        "ExitCnt": 0,
                        "StayCnt": 0
                    }
                ]
            }
        ]
    }
}

Error Code

See Response Messages Body and Common error_code for more information.