# Get

## Function

This API is used to get AI > Recognition > FDGroup page parameters.

## Request Message

## Parameter Description

Table 1 |Parameter|Range|Type|Description| | ---- | ---- | ---- | ---- | |MsgId|null| |moot| |TypeFlags| |int|The detection type combination of the group to be obtained, such as: 1-face, 2-car, 3-person-car (0x1 << DLDT_Face | 0x1 << DLDT_Car), currently only faces are supported | |DefaultVal| |int|Get default alarm parameters or actual alarm parameters, 1- default parameters, 0- actual parameters | |WithInternal| |int|Internal group is not open for users to use, only for storing common faces, the client wants to obtain a list of common faces to use the internal group Id | |SimpleInfo| |int|Get simple information or complete information. Simple information only includes Group name, Id, DetectType, Policy, Enabled, CanDel, Similarity, and complete information includes all parameters of the group. 1- Get abbreviated information, 0- complete information | |GroupsId|[1,2,3….x]|array|Obtain the configuration information of the corresponding group. If the field is empty or does not exist, obtain all the information |

Sample:

    POST /API/AI/FDGroup/Get HTTP/1.1

    {
    	"data": {
    		"MsgId": null,
    		"TypeFlags": 1,
    		"DefaultVal": 0,
    		"WithInternal": 1，
    		"SimpleInfo": 0
    "GroupsId": [
    2,
            ]
    	}
    }

## Response Message

## Parameter Description

#### Table 2

Parameter | Range | Type | Description
--- | --- | --- | ---
MsgId | null |  |
Result | 0，-1，-2，….-23, -24 | int | See Table x for the return result of the request. This field is not required for Modify.
channel_max |  | int | Maximum number of channels
Count | 1-16 | int | Number of groups, used when get
Group |  | int | Face group,Face Group Information JSON See TableTable 5.
export_no_permission |  | bool | Do you have permission to export data (cloud specific)
controls |  | Object | Database interface control, such as tableTable 12As shown (cloud only)

#### Table x

Result type | Description
--- | ---
AORT_SUCCESS = 0 | succeed
AORT_NO_DB = -1 | No database
AORT_DB_EXEC_FAILED = -2 | Database execution failure
AORT_CALC_FEATURE_FAILED = -3 | Feature extraction failure
AORT_CANCELED = -4 | canceled
AORT_NO_DISK = -5 | No hard disk
AORT_DISK_ERROR = -6 | Hard disk error
AORT_EXIST = -7 | Already exist
AORT_GROUP_INVALID = -8 | Group invalid
AORT_NOT_EXIST = -9 | inexistence
AORT_MORE_FILE_EXIST = -10 | File already exists
AORT_SEARCH_ERROR = -11 | Search error
AORT_OVER_MAX_COUNT = -12 | upper limit exceeded
AORT_UPDATING_FEATURE = -13 | Updating feature values
AORT_NO_USABLE_IPC = -14 | There is no IPC vailable for eigenvalue calculation
AORT_INVALID_PARAM = -15 | invalid parameter
AORT_INVALID_FORMAT = -16 | malformed
AORT_INVALID_RES = -17 | resolution error
AORT_INVALID_MEM = -18 | File too large error
AORT_CREAT_FAILED = -19 | create failed
AORT_MD5_NOT_MATCH = -20 | MD5 mismatch
AORT_POS_ERROR = -21 | wrong location
AORT_SIZE_ERROR = -22 | size error
AORT_NOT_READY = -23 | not ready
AORT_INVALID_DB = -24 | invalid database

Table 5 |Parameter|Range|Type|Description| | ---- | ---- | ---- | ---- | |Id||int|Face group ID| |name|"Allow List"
"Block List"
……|string|Face group name, group name can be customized| |DetectType|0,1|int|Detection type 0: face 1: car| |Policy|0-4|int|Policy attributes, 0-Allow List, 1-Block List, 2-Stranger,3-Internal (Internal group is only used to store the most recent face for comparison, not for alarm and other functions), 4-Advance| |Enabled|0,1|int|Face alarm enable 0: off 1: on| |CanDel||int|A predefined group cannot be deleted and is identified by the CanDel field. 0 cannot be deleted| |Similarity|0-100|unsigned int|similarity| |PolicyConfigs||JSON array|Group alarm policy configuration, fixed to two elements, the common group uses the 0 element, advanced group 0 corresponds to Allow, the first corresponds to Deny. PolicyConfigs JSON, as shown in the table Table 6| |EnableChnAlarm|[255, 255, 255, 255]|array|Control the channels in which the corresponding group is allowed to alarm, according to the bit bit position indicates that the corresponding channel is allowed to alarm| |AlarmOut||Object|Alarm output association, Information JSON is shown in table Table 10|

Table 6 |Parameter|Range|Type|Description| | ---- | ---- | ---- | ---- | |ChnAlarmOut|[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ],
...
[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255,0,255] ]|array|Each element represents the alarm output associated with a channel, there are 3 main elements, the 0 th represents the local alarm output, the 1/2 represents the front-end alarm output 0/1, and each bit of the child element indicates whether the alarm output of the channel is associated| |ChnBuzzerOpt|[0, 1, 1, 2, 3, 4, 0, 1, 1, 3, 2, 2 …]|array|Each element indicates the buzzer configuration of a channel, 0-disable, 1-10s, 2-20s, 3-40s, 4-60s| |LatchTimeOpt|[0, 1, 1, 2, 3, 4, 0, 1, 1, 3, 2, 2 …]|array|Each element represents the alarm output duration of a channel, 0-0s, 1-1s, 2-2s, 3-3s, 4-5s, 5-10s, 6-20s, 7-40s, 8-60s| |SaveImg|[255, 255, 255, 255…]|array|Each element represents the configuration of whether a channel saves pictures, and the use of bits in each element indicates whether to save faces and backgrounds| |SendEmail|[0, 0, 0, 0]|array|Used in bits, each bit indicates whether a channel sends mail,0- not to send, 1- to send| |UploadToFtp|[255, 255, 255, 255]|array|Each bit indicates whether a channel uploads FTP| |UploadToCloud|[0, 0, 0, 0]|array|Used in bits, each bit indicates whether a channel is uploading to the Cloud, 0- not uploading, 1- uploading| |ShowThumbnail|[255, 255, 255, 255]|array|Used in bits, each bit represents a channel that is displayed as a thumbnail| |Record|[255, 255, 255, 255]|array|Used in bits, each bit indicates that a channel is recording| |Push|[0, 0, 0, 0]|array|Used by bit, each bit indicates whether a channel sends push, 0- no push, 1- push| |AlarmSchedule|[[255, 255, 255, 255, 255, 255], ...],
[[255, 255, 255, 255, 255, 255] ...]|array|Alarm schedule, each bit represents half an hour, a total of 48 bits, set indicates video, and vice versa| |event_push_platform|[0, 0, 0, 0]|array|Used in bits, each bit indicates whether a channel has event push enabled|

Table 10 |Parameter|Range|Type|Description| | ---- | ---- | ---- | ---- | |Local|"Local->1" "Local->2"
"Local->3"
……
The number of local's depends on the capability of the device.|string array|Local alarm linkage.| |Ipc| |JSON array|Front-end alarm linkage. IPC JSON is shown in table Table 11|

Table 11 |Parameter|Range|Type|Description| | ---- | ---- | ---- | ---- | |Channel| |int|Front-end alarm output associated channel| |AlarmOutCnt| |int|Indicates the number of front-end alarm outputs, front-end support 2 alarm outputs| | alarm_out| | array | The name string of the IO alarm output. The client can use this string to display (cloud only) |

Table 12 |Parameter|Range|Type|Description| | ---- | ---- | ---- | ---- | |column| |Object|The database parameter interface JSON is shown in Table Table 13| |showFaceInfoAllMenu| |bool|Determine whether you have configuration permission. If you do not have configuration permission, hide these three menu options together with the board (Move To option)| |addGroupBtn| |bool|Add Schedule button| |isCanModifyGroupName| |bool|Is it possible to rename the button?| |show_tilte_pre| |bool|Title Display|

Table 13 |Parameter|Range|Type|Description| | ---- | ---- | ---- | ---- | |delete| |bool|Database delete button| |edit| |bool|Database Edit Button| |enable_Enabled| |bool|Database enable button| |enable_EnableAlarm| |bool|Database IO enable button| |policy| |bool|Database permissions interface| |similarity| |bool|Database Similarity| |alarm| |bool|Database alarm linkage button| |alarm_schedule| |bool|Database Schedule Settings Button| |alarm_channel| |bool|Alarm channel|

> Tips:

> Response messages and request messages may not contain all the fields in the table above. If no fields are included, the device does not support this parameter configuration.

Sample:

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
    	"data": {
    		"MsgId": null,
    		"Result": 0,
    		"Count": 5,
    		"Group": [
    			{
    				"Id": 2,
    				"Name": "Block List",
    				"DetectType": 0,
    				"Policy": 0,
    				"Enabled": 1,
    				"CanDel": 0,
    				"Similarity": 70,
    				"PolicyConfigs": [
    					{
    						"ChnAlarmOut": [
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ],
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ],
    							...
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ]
    						  ],
    						  "ChnBuzzerOpt": [0, 1, 1, 2, 3, 4, 0, 1, 1, 3, 2, 2 ],
    						  "LatchTimeOpt": [0, 1, 1, 2, 3, 4, 0, 1, 1, 3, 2, 2 ],
    						  "SaveImg": [255, 255, 255, 255],
    						  "SendEmail": [0, 0, 0, 0],
    						  "UploadToFtp": [255, 255, 255, 255],
    						  "UploadToCloud": [0, 0, 0, 0],
    						  "ShowThumbnail": [255, 255, 255, 255],
    						  "Record": [255, 255, 255, 255],
    						  "Push": [0, 0, 0, 0],
    						  "AlarmSchedule": [
    							[
    								[255, 255, 255, 255, 255, 255],
    								...
    							],
    							[
    								[255, 255, 255, 255, 255, 255],
    								...
    							],
    							...
    						]
    					},
    					{
    						"ChnAlarmOut": [
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ],
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ],
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ],
    							...
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ]
    						  ],
    						  "ChnBuzzerOpt": [0, 1, 1, 2, 3, 4, 0, 1, 1, 3, 2, 2 ],
    						  "LatchTimeOpt": [0, 1, 1, 2, 3, 4, 0, 1, 1, 3, 2, 2 ],
    						  "SaveImg": [255, 255, 255, 255],
    						  "SendEmail": [0, 0, 0, 0],
    						  "UploadToFtp": [255, 255, 255, 255],
    						  "UploadToCloud": [0, 0, 0, 0],
    						  "ShowThumbnail": [255, 255, 255, 255],
    						  "Record": [255, 255, 255, 255],
    						  "Push": [0, 0, 0, 0],
    						  "AlarmSchedule": [
    							[
    								[255, 255, 255, 255, 255, 255],
    								...
    							],
    							[
    								[255, 255, 255, 255, 255, 255],
    								...
    							],
    							...
    						]
    					}
    				],
    				"EnableChnAlarm": [255, 255, 255, 255]，
    				"AlarmOut": {
    					"Local": ["Local->1"],
    					"Ipc": [{
    						"Channel": 1,
    						"AlarmOutCnt": 1
    					}, {
    						"Channel": 4,
    						"AlarmOutCnt": 1
    					}, {
    						"Channel": 5,
    						"AlarmOutCnt": 1
    					}]
    				}
    			},
    			...

    		]
    	}
    }

Example (cloud only):

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
    	"data": {
    		"MsgId": null,
    		"Result": 0,
    		"Count": 5,
    		"controls": {
    			"column": {
    				"delete": true,
    				"edit": true,
    				"enable_Enabled": true,
    				"enable_EnableAlarm": true,
    				"policy": true,
    				"similarity": true,
    				"alarm": true,
    				"alarm_schedule": true,
    				"alarm_channel": true
    			},
    			"showFaceInfoAllMenu": true,
    			"addGroupBtn": true,
    			"isCanModifyGroupName": true,
    			"show_tilte_pre": true
    		},
    		"Group": [
    			{
    				"Id": 2,
    				"Name": "Block List",
    				"DetectType": 0,
    				"Policy": 0,
    				"Enabled": 1,
    				"CanDel": 0,
    				"Similarity": 70,
    				"PolicyConfigs": [
    					{
    						"ChnAlarmOut": [
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ],
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ],
    							...
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ]
    						  ],
    						  "ChnBuzzerOpt": [0, 1, 1, 2, 3, 4, 0, 1, 1, 3, 2, 2 ],
    						  "LatchTimeOpt": [0, 1, 1, 2, 3, 4, 0, 1, 1, 3, 2, 2 ],
    						  "SaveImg": [255, 255, 255, 255],
    						  "SendEmail": [0, 0, 0, 0],
    						  "UploadToFtp": [255, 255, 255, 255],
    						  "UploadToCloud": [0, 0, 0, 0],
    						  "ShowThumbnail": [255, 255, 255, 255],
    						  "Record": [255, 255, 255, 255],
    						  "Push": [0, 0, 0, 0],
    						  "AlarmSchedule": [
    							[
    								{
    									"enable": true,
    									"weekday": [
    										"Sunday",
    										"Thursday"
    									],
    									"start_time": 120,
    									"end_time": 540
    								},
    								...
    							],
    							[
    								{
    									"enable": true,
    									"weekday": [
    										"Sunday",
    										"Thursday"
    									],
    									"start_time": 120,
    									"end_time": 540
    								},
    								...
    							],
    							...
    						]
    					},
    					{
    						"ChnAlarmOut": [
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ],
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ],
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ],
    							...
    							[ [255, 255, 0, 255], [255, 255, 0, 255], [255, 255, 0, 255] ]
    						  ],
    						  "ChnBuzzerOpt": [0, 1, 1, 2, 3, 4, 0, 1, 1, 3, 2, 2 ],
    						  "LatchTimeOpt": [0, 1, 1, 2, 3, 4, 0, 1, 1, 3, 2, 2 ],
    						  "SaveImg": [255, 255, 255, 255],
    						  "SendEmail": [0, 0, 0, 0],
    						  "UploadToFtp": [255, 255, 255, 255],
    						  "UploadToCloud": [0, 0, 0, 0],
    						  "ShowThumbnail": [255, 255, 255, 255],
    						  "Record": [255, 255, 255, 255],
    						  "Push": [0, 0, 0, 0],
    						  "AlarmSchedule": [
    							[
    								{
    									"enable": true,
    									"weekday": [
    										"Sunday",
    										"Thursday"
    									],
    									"start_time": 120,
    									"end_time": 540
    								},
    								...
    							],
    							[
    								{
    									"enable": true,
    									"weekday": [
    										"Sunday",
    										"Thursday"
    									],
    									"start_time": 120,
    									"end_time": 540
    								},
    								...
    							],
    							...
    						]
    					}
    				],
    				"EnableChnAlarm": [255, 255, 255, 255]，
    				"AlarmOut": {
    					"Local": ["Local->1"],
    					"Ipc": [{
    						"Channel": 1,
    						"AlarmOutCnt": 1,
    						"CH2(172.16.11.134)->1"
    					}, {
    						"Channel": 4,
    						"AlarmOutCnt": 1
    						"CH2(172.16.11.135)->1"
    					}, {
    						"Channel": 5,
    						"AlarmOutCnt": 1
    						"CH2(172.16.11.136)->1"
    					}]
    				}
    			},
    			...

    		]
    	}
    }

## Error Code

See Response Messages Body and Common error_code for more information.