7/25/2019 Koala API V3.1.0 Koala API V3.1.0 Koala API V3.1.0 Release date: Jul. 24, 2019 Online- Permissions Interface ................................................................................................................. 7 Logout [api]............................................................................................................................................. 7 Basic information ............................................................................................................................................ 7 Request parameters ....................................................................................................................................... 7 Return data ..................................................................................................................................................... 7 Login ...................................................................................................................................................... 7 Basic information ............................................................................................................................................ 7 Request parameters ....................................................................................................................................... 8 Return data ..................................................................................................................................................... 8 Online- System Management ................................................................................................................. 9 Delete a single access control device ..................................................................................................... 9 Basic information ............................................................................................................................................ 9 Request parameters ....................................................................................................................................... 9 Return data ..................................................................................................................................................... 9 Create access control device .................................................................................................................. 9 Basic information ............................................................................................................................................ 9 Request parameters .....................................................................................................................................10 Return data ...................................................................................................................................................10 Update a single access control device ...................................................................................................11 Basic information ..........................................................................................................................................11 Request parameters .....................................................................................................................................11 Return data ...................................................................................................................................................11 Get a single access control device.........................................................................................................12 Basic information ..........................................................................................................................................12 Request parameters .....................................................................................................................................12 Return data ...................................................................................................................................................12 Get all hosts ..........................................................................................................................................13 Basic information ..........................................................................................................................................13 Request parameters .....................................................................................................................................13 Return data ...................................................................................................................................................13 Get access control device list ................................................................................................................14 Basic information ..........................................................................................................................................14 Request parameters .....................................................................................................................................14 Return data ...................................................................................................................................................14 Online - Recognition Records ................................................................................................................15 Delete a single recognition record..........................................................................................................15
71
Embed
Koala API V3.1 - megvii.nvk.co.th API V3.1(English... · 7/25/2019 Koala API V3.1.0 Koala API V3.1.0 Online- Permissions Interface Logout [api] Basic information Path: /api/v2/auth
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Basic information ............................................................................................................................................ 7
Return data ..................................................................................................................................................... 7
Basic information ............................................................................................................................................ 7
Return data ..................................................................................................................................................... 8
Online- System Management ................................................................................................................. 9
Delete a single access control device ..................................................................................................... 9
Basic information ............................................................................................................................................ 9
Return data ..................................................................................................................................................... 9
Create access control device .................................................................................................................. 9
Basic information ............................................................................................................................................ 9
Return data ................................................................................................................................................... 10
Update a single access control device ...................................................................................................11
Basic information .......................................................................................................................................... 11
Return data ................................................................................................................................................... 11
Get a single access control device.........................................................................................................12
Basic information .......................................................................................................................................... 12
Return data ................................................................................................................................................... 12
Get all hosts ..........................................................................................................................................13
Basic information .......................................................................................................................................... 13
Return data ................................................................................................................................................... 13
Get access control device list ................................................................................................................14
Basic information .......................................................................................................................................... 14
Return data ................................................................................................................................................... 14
Online - Recognition Records ................................................................................................................15
Delete a single recognition record..........................................................................................................15
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Basic information .......................................................................................................................................... 15
Return data ................................................................................................................................................... 16
History traversal interface ......................................................................................................................16
Basic information .......................................................................................................................................... 16
Interface use ................................................................................................................................................. 16
Return data ................................................................................................................................................... 17
Recognition record list ...........................................................................................................................17
Basic information .......................................................................................................................................... 17
Return data ................................................................................................................................................... 19
Batch delete recognition records ...........................................................................................................20
Basic information .......................................................................................................................................... 20
Return data ................................................................................................................................................... 21
Basic information .......................................................................................................................................... 21
Return data ................................................................................................................................................... 21
Personnel List ........................................................................................................................................22
Basic information .......................................................................................................................................... 22
Return data ................................................................................................................................................... 22
Personnel head portrait .........................................................................................................................23
Basic information .......................................................................................................................................... 23
Return data ................................................................................................................................................... 24
Quality inspection on images to enter the library ....................................................................................24
Basic information .......................................................................................................................................... 24
Quality inspection on images to enter the library ......................................................................................... 24
Return data ................................................................................................................................................... 25
Create user ............................................................................................................................................25
Basic information .......................................................................................................................................... 25
Return data ................................................................................................................................................... 26
Create user and upload to library ...........................................................................................................27
Basic information .......................................................................................................................................... 27
Return data ................................................................................................................................................... 27
Basic information .......................................................................................................................................... 28
Return data ................................................................................................................................................... 29
Delete data of a single subject ...............................................................................................................29
Basic information .......................................................................................................................................... 29
Return data ................................................................................................................................................... 30
Update data of a single subject ..............................................................................................................30
Basic information .......................................................................................................................................... 30
Return data ................................................................................................................................................... 31
Get data of a single subject ...................................................................................................................32
Basic information .......................................................................................................................................... 32
Return data ................................................................................................................................................... 32
Attendance record .................................................................................................................................33
Basic information .......................................................................................................................................... 33
Return data ................................................................................................................................................... 34
Interface for comprehensive statistics on homepage .............................................................................35
Basic information .......................................................................................................................................... 35
Return data ................................................................................................................................................... 35
Online- Access Control Group ...............................................................................................................35
Get access control group list..................................................................................................................35
Basic information .......................................................................................................................................... 35
Return data ................................................................................................................................................... 36
Get access control group and contained access controls ......................................................................36
Basic information .......................................................................................................................................... 36
Return data ................................................................................................................................................... 37
Create access control group ..................................................................................................................37
Basic information .......................................................................................................................................... 37
Return data ................................................................................................................................................... 38
Update access control group .................................................................................................................38
Basic information .......................................................................................................................................... 38
Return data ................................................................................................................................................... 39
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Delete access control group ..................................................................................................................39
Basic information .......................................................................................................................................... 39
Return data ................................................................................................................................................... 39
Add access control to access control group ...........................................................................................39
Basic information .......................................................................................................................................... 39
Return data ................................................................................................................................................... 40
Delete access control from access control group ...................................................................................40
Basic information .......................................................................................................................................... 40
Return data ................................................................................................................................................... 41
Online- Personnel Group .......................................................................................................................41
Get personnel group list .........................................................................................................................41
Basic information .......................................................................................................................................... 41
Return data ................................................................................................................................................... 41
Get personnel group and contained personnel ......................................................................................42
Basic information .......................................................................................................................................... 42
Return data ................................................................................................................................................... 42
Create personnel group .........................................................................................................................43
Basic information .......................................................................................................................................... 43
Return data ................................................................................................................................................... 44
Update personnel group ........................................................................................................................44
Basic information .......................................................................................................................................... 44
Return data ................................................................................................................................................... 44
Add personnel to personnel group .........................................................................................................45
Basic information .......................................................................................................................................... 45
Return data ................................................................................................................................................... 45
Delete personnel from personnel group .................................................................................................45
Basic information .......................................................................................................................................... 45
Return data ................................................................................................................................................... 46
Online- Access Control Permissions ......................................................................................................46
Create access control settings ...............................................................................................................46
Basic information .......................................................................................................................................... 46
Return data ................................................................................................................................................... 47
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Delete access control settings ...............................................................................................................47
Basic information .......................................................................................................................................... 47
Return data ................................................................................................................................................... 48
Update access control settings ..............................................................................................................48
Basic information .......................................................................................................................................... 48
Return data ................................................................................................................................................... 48
Get access control setting list ................................................................................................................49
Basic information .......................................................................................................................................... 49
Return data ................................................................................................................................................... 49
Online- Access Control Period & Holiday Management .........................................................................50
Get period list ........................................................................................................................................50
Basic information .......................................................................................................................................... 50
Return data ................................................................................................................................................... 51
Create period rule ..................................................................................................................................53
Basic information .......................................................................................................................................... 53
Return data ................................................................................................................................................... 55
Update period rule .................................................................................................................................55
Basic information .......................................................................................................................................... 55
Return data ................................................................................................................................................... 56
Delete period rule ..................................................................................................................................57
Basic information .......................................................................................................................................... 57
Return data ................................................................................................................................................... 57
Get holiday list .......................................................................................................................................58
Basic information .......................................................................................................................................... 58
Return data ................................................................................................................................................... 58
Basic information .......................................................................................................................................... 59
Return data ................................................................................................................................................... 60
Basic information .......................................................................................................................................... 60
Return data ................................................................................................................................................... 61
Basic information .......................................................................................................................................... 61
Return data ................................................................................................................................................... 61
Host- System Management ...................................................................................................................62
Host NTP client control ..........................................................................................................................62
Basic information .......................................................................................................................................... 62
Return data ................................................................................................................................................... 62
Basic information .......................................................................................................................................... 62
Return data ................................................................................................................................................... 63
Callback face capture image status .......................................................................................................63
Basic information .......................................................................................................................................... 63
Return data ................................................................................................................................................... 63
Set callback address .............................................................................................................................63
Basic information .......................................................................................................................................... 63
Return data ................................................................................................................................................... 64
Basic information .......................................................................................................................................... 64
Return data ................................................................................................................................................... 65
Basic information .......................................................................................................................................... 65
Return data ................................................................................................................................................... 66
Get recognition result.............................................................................................................................66
Basic information .......................................................................................................................................... 66
Return data ................................................................................................................................................... 68
Static 1:n recognition .............................................................................................................................68
Basic information .......................................................................................................................................... 68
Return data ................................................................................................................................................... 69
Error code information .................................................................................................................................. 69
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Online- Permissions Interface
Logout [api]
Basic information
Path: /api/v2/auth
Method: DELETE
Tag: open
Interface description:
Logout interface, belonging to api v2.
Compared with the previous version /auth/logout, the http method is switched to delete, and finally there is no redirect operation.
Parameter name Parameter value Required Example Remarks
Query
Name Type Required Remarks Example Other
information
category
No Type: String, available values: user: All; visitor: Visitor; Fmp:
Non-living body; yellowlist: Yellow list, warning: Stranger user
start
No Start timestamp, type: int, default: 0 0
end
No End timestamp, type: Int, default: 9999999999 9999999999
user_role
No Filter conditions: User type & Event type, Type: Int 2
user_name
No User name, type: String user
screen_id
No Camera id, type: Int 1
subject_id
No Subject id, type: Int 1024
page
No Page number 2
size
No Data volume in the page 10
Return data
Body
Name Type Required Remarks Example Other information
code number No
data array No
array[object]
├─ confidence number No Confidence
├─ fmp_error boolean No Whether living
├─ group number No
├─ event_type number No Event type
├─ timestamp number No
├─ gender number No Gender
├─ age number No Age
├─ company_id number No Company id
├─ fmp number No fmp score
├─ subject_id null No
├─ photo string No Face capture image path
├─ screen object No
├─ camera_position string No Camera location
├─ uuid [u'string', u'null'] No
├─ quality number No Quality
├─ id number No
├─ subject object No
├─ subject_type number No Type
├─ avatar string No Head portrait
├─ name string No Name
page object No
├─ count number No
├─ current number No
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Name Type Required Remarks Example Other information
├─ total number No
├─ size number No
Batch delete recognition records
Basic information
Path: /event/events
Method: DELETE
Tag: open,Koala3.1.0
Interface description:
The interface for batch deleting recognition records. The parameters used here are basically the same as those for getting the recognition record list.
The data is returned directly after the request. The deletion will be performed by koala_worker at the backend.
Only the company administrator can see the front-end button and perform the sub-task.
event_type
○ 0: Recognition
○ 1: Unrecognized
○ 2: Open the door with password
start: Start timestamp
end: End timestamp
User_role subject and event_type combined filtering parameters
○ 0: Employee
○ 1: Ordinary visitor
○ 2: VIP visitor
○ 3: Yellow list
○ 4: Unrecognized type data, i.e., event_type=1
category: Categories
○ user: event_type: including 1, 0
○ visitor: subject_type: 1: Ordinary visitor
○ fmp: fmp_error = 1
○ yellowlist: subject_type: 3: Yellow list
○ Others: subject_type: -1
screen_id: Camera id, that is, the search can only be made on cameras that haven't been deleted at this time.
user_name: User name
subject_id: User id, not in use at the moment
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Parameter name Parameter value Required Example Remarks
Content-Type multipart/form-data Yes
Body
Name Type Required Remarks Example Other information
avatar file Yes Head portrait image
subject_id text No subject id
Return data
Body
Name Type Required Remarks Example Other information
code number Yes
data object Yes
├─ url string No Head portrait path
├─ image_uri string No Image path
page object Yes
Quality inspection on images to enter the library
Basic information
Path: /subject/photo/check
Method: POST
Tag: Koala3.1.0,open
Interface description:
Quality inspection on images to enter the library
Check whether an image is qualified to enter the library
The following is returned after passing the quality inspection
{
"code": 0,
"data": {},
"page": {}
}
Error information is returned upon failure to pass quality inspection, such as
{
"code": -300,
"data": {},
"desc": "没有检测到人脸 (error: 300)"
}
Request parameters
Headers
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Parameter name Parameter value Required Example Remarks
Content-Type multipart/form-data Yes
Body
Name Type Required Remarks Example Other information
photo file Yes Image file
Return data
Body
Name Type Required Remarks Example Other information
code number No
data object No
page object No
Create user
Basic information
Path: /subject
Method: POST
Tag: open,Koala3.1.0
Interface description:
Interface for creating subjects. Employees, visitors, and yellow lists are all created through this interface.
First call the /subject/photo interface to get the library data, and then pass it in photo_ids.
avatar: For version 3.1.0, this information can be passed in for avatar at the moment: image base64 code (i.e., the old usage mode is also supported)
and head portrait path [see: /subject/avatar]
When subject_type is 0/3, i.e., employee/yellow list, it can be created with name and subject_type alone.
When subject_type is 1/2, that is, visitor/vip, besides name and subject_type, start_time and end_time also need to be passed in.
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type application/json Yes
Body
Name Type Required Remarks Example Other information
subject_type number Yes Type, 0: employee, 1: visitor, 2: vip, 3: yellow list
create_time number No Time created
job_number string No Employee number, length: 64
visitor_type number No Visitor type, 1: visitor, 2: vip visitor
title string No Position, length: 64
entry_date number No Entry date. Timestamp is passed for processing at the backend.
department string No Department, length: 256
email string No Email address, length: 64
photo_ids array No Library id list
array[number]
avatar string No Head portrait, image base64 code, length: 256
description string No Signature, length: 128
start_time number No Visitor start time, timestamp
interviewee string No Visitee, length: 20
phone string No Phone, length: 20
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Name Type Required Remarks Example Other information
birthday number No Birth date. Timestamp is passed for processing at the backend.
purpose number No Visiting purpose
come_from string No From, for visitors, length: 128
remark string No Remarks, length: 128
group_ids array No Group id
array[integer]
name string Yes Name, length: 64
gender number No Gender, 0: unknown, 1: male, 2: female
end_time number No Visitor end time, timestamp
Return data
Body
Name Type Required Remarks Example Other information
code number No
data object No
├─ subject_type number No Type
├─ visit_notify boolean No Whether to push notification to app
├─ create_time number No Time created
├─ id number No id
├─ title string No Position
├─ company_id number No Company id
├─ job_number string No Employee number
├─ entry_date number No Entry date, timestamp
├─ department string No Department
├─ email string No Email address
├─ end_time number No Visitor end time
├─ password_reseted boolean No
├─ description string No Signature
├─ pinyin string No Name in pinyin
├─ start_time number No Visitor start time
├─ interviewee string No Visitee name
├─ phone string No Phone
├─ birthday number No Birth date, timestamp
├─ purpose number No Visiting purpose
├─ groups object No Group
├─ id integer No Group id
├─ name string No Group name
├─ come_from string No From
├─ remark string No Remarks
├─ name string No Name
├─ photos array No Library list
array[object]
├─ url string No Image address
├─ subject_id number No subject id
├─ company_id number No Company id
├─ version number No Version
├─ quality number No Quality
├─ id number No id
├─ gender number No Gender
├─ avatar string No Head portrait url
├─ interviewee_pinyin string No Visitee name in pinyin
page object No
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Create user and upload to library
Basic information
Path: /subject/file
Method: POST
Tag: Koala3.1.0,open
Interface description:
Interface for creating subjects at the backend only. Head portrait and library parameters are used in the form of files. Employees, visitors and yellow
lists are all created through this interface.
When subject_type is 0/3, i.e., employee/yellow list, it can be created with name and subject_type alone.
When subject_type is 1/2, that is, visitor/vip, besides name and subject_type, start_time and end_time also need to be passed in.
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type multipart/form-data Yes
Body
Name Type Required Remarks Example Other information
avatar file No Head portrait
birthday text No Birth date. Timestamp is passed for processing at the backend.
come_from text No From, for visitors, length: 128
department text No Department, length: 256
description text No Signature, length: 128
email text No Email address, length: 64
end_time text No Visitor end time, timestamp
entry_date text No Entry date. Timestamp is passed for processing at the backend.
gender text No Gender, 0: unknown, 1: male, 2: female
group_ids text No Group id
interviewee text No Visitee, length: 20
job_number text No Employee number, length: 64
name text Yes Name, length: 64
phone text No Phone, length: 20
photo file No Library image
purpose text No Visiting purpose
remark text No Remarks, length: 128
start_time text No Visitor start time, timestamp
subject_type text Yes Type, 0: employee, 1: visitor, 2: vip, 3: yellow list
title text No Position, length: 64
visitor_type text No Visitor type, 1: visitor, 2: vip visitor
Return data
Body
Name Type Required Remarks Example Other information
code number No
data object No
├─ subject_type number No Type
├─ visit_notify boolean No Whether to push notification to app
├─ create_time number No Time created
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Name Type Required Remarks Example Other information
├─ id number No id
├─ title string No Position
├─ company_id number No Company id
├─ job_number string No Employee number
├─ entry_date number No Entry date, timestamp
├─ department string No Department
├─ email string No Email address
├─ end_time number No Visitor end time
├─ password_reseted boolean No
├─ description string No Signature
├─ pinyin string No Name in pinyin
├─ start_time number No Visitor start time
├─ interviewee string No Visitee name
├─ phone string No Phone
├─ birthday number No Birth date, timestamp
├─ purpose number No Visiting purpose
├─ groups object No Group
├─ id integer No Group id
├─ name string No Group name
├─ come_from string No From
├─ remark string No Remarks
├─ name string No Name
├─ photos array No Library list
array[object]
├─ url string No Image address
├─ subject_id number No subject id
├─ company_id number No Company id
├─ version number No Version
├─ quality number No Quality
├─ id number No id
├─ gender number No Gender
├─ avatar string No Head portrait url
├─ interviewee_pinyin string No Visitee name in pinyin
page object No
Delete subject library
Basic information
Path: /subject/photo
Method: DELETE
Tag: open,Koala3.1.0
Interface description:
Delete all libraries for the specified subject
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Online- Access Control Period & Holiday Management
Get period list
Basic information
Path: /access/schedule/list
Method: GET
Tag: open
Interface description:
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Query
Name Type Required Remarks Example Other information
page
No Default: 1 1
size
No Default: 10 50
id
No Filter a single item 1
status
No 0: Deleted, 1: Effective 1
name
No Fuzzy search: Rule name abc
update_user_name
No Fuzzy search: Operator user name admin
order_by
No enum: 'id', 'name', 'update_time', 'update_by' update_time
order
No enum: 'asc', 'desc' desc
Return data
Body
{
"code": 0,
"data": [
{
"comment": "what the",
"end_time": "2019-10-01",
"id": 1,
"name": "test_schedule_2",
"start_time": "2019-05-29",
"time_range": [
[
[
1,
2
],
[
3,
4
]
],
[],
[
[
2000,
3000
],
[
7000,
80000
]
],
[],
[],
[],
[
[
1,
2
],
[
2,
3
],
[
3,
4
]
]
]
},
{
"comment": "no comment",
"end_time": "2019-09-01",
"id": 2,
"name": "first_schedule",
"start_time": "2019-06-01",
"time_range": [
[
[
39216,
46911
],
[
48494,
62614
]
],
[
[
43753,
43824
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
],
[
52533,
75469
],
[
80957,
82878
]
],
[
[
39054,
47995
],
[
51790,
57973
],
[
74060,
83615
]
],
[
[
26476,
30670
],
[
46794,
52777
],
[
53303,
76750
]
],
[
[
76921,
78375
]
],
[],
[]
]
},
{
"comment": "comment here",
"end_time": "2019-07-01",
"id": 5,
"name": "test_schedule_",
"start_time": "2019-01-01",
"time_range": [
[
[
16512,
26370
],
[
33716,
34645
],
[
0,
0
]
],
[
[
34333,
36367
]
],
[
[
20316,
36497
],
[
49312,
68899
],
[
72438,
75984
]
],
[
[
16373,
29782
],
[
33024,
34070
]
],
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
[
[
47184,
48145
],
[
63733,
68268
]
],
[
[
21206,
36286
],
[
57982,
60134
]
],
[
[
32353,
49341
],
[
70852,
77301
],
[
78225,
79578
]
]
]
}
],
"page": {
"count": 3,
"current": 1,
"size": 50,
"total": 1
}
}
Create period rule
Basic information
Path: /access/schedule
Method: PUT
Tag: open
Interface description:
Parameter description:
name: String, maximum length 40, required
comment: String, maximum length 120, optional
start_time: string, a date formatted in "%Y-%m-%d", optional, the current day by default
end_time: string, a date formatted in "%Y-%m-%d", required
time_range, required, <list<pair(int, int)>>; a three-dimensional array with a length of 7.
pair = time_range[i][j] indicates the j-th setting on the i-th day of each week.
pair[0] is the start time and pair[1] is the end time. The value is the number of seconds elapsed from 0.
Request parameter sample:
{
"name": "test_schedule",
"comment": "comment here",
"time_range": [
[
[
16512,
26370
],
[
33716,
34645
],
[
0,
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
0
]
],
[
[
34333,
36367
]
],
[
[
20316,
36497
],
[
49312,
68899
],
[
72438,
75984
]
],
[
[
16373,
29782
],
[
33024,
34070
]
],
[
[
47184,
48145
],
[
63733,
68268
]
],
[
[
21206,
36286
],
[
57982,
60134
]
],
[
[
32353,
49341
],
[
70852,
77301
],
[
78225,
79578
]
]
],
"start_time": "2019-01-01",
"end_time": "2019-07-01"
}
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type application/json Yes
Body
Name Type Required Remarks Example Other information
comment string No
start_time string No
end_time string No
name string Yes
time_range array Yes
array[array]
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Return data
Body
Name Type Required Remarks Example Other information
code number No
data object No
├─ comment string No
├─ name string No
├─ start_time string No
├─ time_range array No
array[array]
├─ end_time string No
├─ id number No
page object No
Update period rule
Basic information
Path: /access/schedule/{id}
Method: POST
Tag: open
Interface description:
Parameters are the same as those indicated in “Create period rule”.
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type application/json Yes
Path parameter
Name Type Required Remarks Example Other information
id
No Period rule id, type: int 1
Body
{
"name": "first_schedule",
"comment": "no comment",
"time_range": [
[
[
39216,
46911
],
[
48494,
62614
]
],
[
[
43753,
43824
],
[
52533,
75469
],
[
80957,
82878
]
],
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
[
[
39054,
47995
],
[
51790,
57973
],
[
74060,
83615
]
],
[
[
26476,
30670
],
[
46794,
52777
],
[
53303,
76750
]
],
[
[
76921,
78375
]
],
[],
[]
],
"start_time": "2019-06-01",
"end_time": "2019-09-01"
}
Return data
Body
{
"code": 0,
"data": {
"id": 2,
"comment": "no comment",
"end_time": "2019-09-01",
"name": "first_schedule",
"start_time": "2019-06-01",
"time_range": [
[
[
39216,
46911
],
[
48494,
62614
]
],
[
[
43753,
43824
],
[
52533,
75469
],
[
80957,
82878
]
],
[
[
39054,
47995
],
[
51790,
57973
],
[
74060,
83615
]
],
[
[
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
26476,
30670
],
[
46794,
52777
],
[
53303,
76750
]
],
[
[
76921,
78375
]
],
[],
[]
]
},
"page": {}
}
Delete period rule
Basic information
Path: /access/schedule/{id}
Method: DELETE
Tag: open
Interface description:
Parameter:
extra: Remark information when deleting, length of serialized json should not exceed 1024.
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type application/json Yes
Path parameter
Name Type Required Remarks Example Other information
id
No Period rule id, type: int
Body
{
"extra": {
"start_time": "2000-01-01",
"end_time": "2020-01-01"
}
}
Return data
Body
{
"code": 0,
"data": {},
"page": {}
}
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Get holiday list
Basic information
Path: /access/calendar/list
Method: GET
Tag: open
Interface description:
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Query
Name Type Required Remarks Example Other information
id
No Filter a single item 1
page
No Default: 1 1
size
No Default: 10 10
name
No Fuzzy search: Rule name abc
update_user_name
No Fuzzy search: Operator user name admin
order_by
No enum: 'id', 'name', 'update_time', 'update_by' update_time
order
No enum: 'asc', 'desc' desc
Return data
Body
{
"code": 0,
"data": [
{
"comment": "",
"date_range": [
[
2019,
1,
1
],
[
0,
12,
25
],
[
0,
0,
7
],
[
2020,
1,
1
]
],
"id": 1,
"name": "calendar_x"
},
{
"comment": "nothing",
"date_range": [
[
2019,
1,
1
],
[
2019,
1,
2
],
[
2019,
1,
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
3
],
[
0,
12,
25
],
[
0,
0,
10
]
],
"id": 2,
"name": "test"
},
{
"comment": "nothing",
"date_range": [
[
0,
0,
1
]
],
"id": 3,
"name": "test2"
}
],
"page": {
"count": 3,
"current": 1,
"size": 50,
"total": 1
}
}
Create holiday rule
Basic information
Path: /access/calendar
Method: PUT
Tag: open
Interface description:
Parameter:
name: String, maximum length 40, required
comment: String, maximum length 120, optional
Date_range, required, list, a two-dimensional array.
date = date_range[i] indicates the i-th in a set of settings date[0], date[1], and date[2] indicate year, month, and day, respectively, and 0 is the wildcard character. For example, [0, 0, 1] indicates the 1st day of each month, and [2019, 7, 0] indicates any day in July 2019.
Parameter sample:
{
"name": "test",
"comment": "nothing",
"date_range": [
[
2019,
1,
1
],
[
2019,
1,
2
],
[
0,
12,
25
],
[
0,
0,
10
]
]
}
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type application/json Yes
Body
Name Type Required Remarks Example Other information
comment string No
date_range array Yes
array[array]
name string Yes
Return data
Body
Name Type Required Remarks Example Other information
code number No
data object No
├─ comment string No
├─ date_range array No
array[array]
├─ id number No
├─ name string No
page object No
Update holiday rule
Basic information
Path: /access/calendar/{id}
Method: POST
Tag: open
Interface description:
Parameter requirements are the same as those indicated in “Create holiday rule”.
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type application/json Yes
Path parameter
Name Type Required Remarks Example Other information
id
No Holiday rule id, type: int
Body
{
"name": "test4",
"comment": "nothing",
"date_range": [
[
2020,
1,
31
]
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
]
}
Return data
Body
{
"code": 0,
"data": {
"comment": "nothing",
"date_range": [
[
2020,
1,
31
]
],
"id": 4,
"name": "test4"
},
"page": {}
}
Delete holiday rule
Basic information
Path: /access/calendar/{id}
Method: DELETE
Tag: open
Interface description:
Parameter:
extra: Remark information when deleting, length of serialized json should not exceed 1024.
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type application/json Yes
Path parameter
Name Type Required Remarks Example Other information
id
No Holiday rule id, type: int
Body
{
"extra": {
"重复": "年",
"假日": "10月 1日/10月 2日"
}
}
Return data
Body
{
"code": 0,
"data": {},
"page": {}
}
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Host- System Management
Host NTP client control
Basic information
Path: /api/v2/system/ntp-client-service
Method: POST
Tag:
Interface description:
Host NTP client control
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type application/json Yes
Authorization
Yes
Body
Name Type Required Remarks Example Other information
cmd string No start, stop
Return data
Body
Name Type Required Remarks Example Other information
code number No
data object No
page object No
Host NTP client configuration
Basic information
Path: /api/v2/system/ntp-client
Method: POST
Tag:
Interface description:
Host NTP client configuration
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type application/json Yes
Authorization
Yes
Body
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Name Type Required Remarks Example Other information
server_address string No
range_m number No
port number No
Return data
Body
Name Type Required Remarks Example Other information
code number No
data object No
page object No
Callback face capture image status
Basic information
Path: /api/v2/system/callback/photo
Method: PUT
Tag:
Interface description:
Callback face capture image status
Indicates whether the face capture image is returned upon callback
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type application/json Yes
Authorization
Yes
Body
Name Type Required Remarks Example Other information
status number No 1: returned, 0: not returned
Return data
Body
Name Type Required Remarks Example Other information
code number No
data object No
page object No
Set callback address
Basic information
Path: /api/v2/system/callback
Method: PUT
Tag:
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Interface description:
Set callback address
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type application/json Yes
Authorization
Yes
Body
Name Type Required Remarks Example Other information
callback_url string Yes
Return data
Body
Name Type Required Remarks Example Other information
code number No
data object No
page object No
Host-Recognition
1: 1 authentication
Basic information
Path: /checkin
Method: POST
Tag:
Interface description:
1: 1 authentication
person_id: Identify the personnel id in the library
When person_id is passed in,
○ the verify interface is used to compare the image with the specified person id.
When person_id is not passed in,
○ the recognize interface is used to identify the image and return the personnel id.
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type multipart/form-data Yes
Body
Name Type Required Remarks Example Other information
image file Yes Image
person_id text No Personnel ID, i.e., subject.id 42
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Return data
Body
Name Type Required Remarks Example Other information
code number No
data object No
├─ person_id number No Personnel ID
page object No
Dynamic 1:1 interface
Basic information
Path: /video_verify
Method: POST
Tag:
Interface description:
Description:
Check for personnel in the image or feature from the video screen.
Parameter:
Parameter Type Description
url str Video stream address, for example: rtsp://10.101.1.60/live1.sdp. This parameter must be passed to
url encode before being passed to the server.
rect
(optional) string/JSON
rect indicates the position of the human face, and four numbers are passed in in format of
100,110,120,130 (the four numbers represent left, up, right and down, respectively).If rect is
passed in, the face detection step will be skipped and the face position specified by rect will be
directly used for calculation.
image file Image
Return value description:
{
"face_info": {
"rect": {
"left": 197,
"top": 454,
"right": 752,
"bottom": 1009
},
}
"result": {
"confidence": 92.330423,
"result": {
"track": 7,
"quality": 0.975,
"rect": {
"left": 688,
"top": 394,
"right": 1028,
"bottom": 734
},
"image": "Base64 encoded JPEG image"
},
"recognized": true
},
}
result.confidence represents the confidence level, result.result represents the inspection result, and result.recognized represents
whether it matches the person in the image/feature. Face_info represents the information of the input image.
The interface will first check the faces not earlier than the request time time.gate_reserve, and if any matching face is included in this period, it
will output directly. If not, it will wait for the maximum time.gate_wait. If still not, the most similar human face will be output. These two times are
set to 3 seconds and 2 seconds by default, respectively. This means that the search will be carried out within 5 seconds. If no face is detected during
this period of time, neither result.confidence nor result.result exists.
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
Request parameters
Headers
Parameter name Parameter value Required Example Remarks
Content-Type multipart/form-data Yes
Body
Name Type Required Remarks Example Other
information
image file Yes
url text Yes
Video stream address, for example: rtsp://10.101.1.60/live1.sdp.
This parameter must be passed to url encode before being
passed to the server.
rect text No
rect indicates the position of the human face, and four numbers
are passed in in format of 100,110,120,130 (the four numbers
represent left, up, right and down, respectively). If rect is passed
in, the face detection step will be skipped and the face position
specified by rect will be directly used for calculation.
Return data
Body
Name Type Required Remarks Example Other information
result object No
├─ confidence number No
├─ result object No
├─ track number No
├─ image string No
├─ quality number No
├─ rect object No
├─ top number No
├─ right number No
├─ bottom number No
├─ left number No
├─ recognized boolean No
face_info object No
├─ rect object No
├─ top number No
├─ right number No
├─ bottom number No
├─ left number No
Get recognition result
Basic information
Path: /video
Method: GET
Tag:
Interface description:
Note: This request parameter is a GET parameter, for example: ws://192.168.1.50:9000/video?url=rtsp%3A%2F%2F192.169.1.60%2Fuser%3Dadmin%26password%3D%26channel%3D1%26stream%3D0.sdp
Return value description:
The algorithm takes all the images of a person from appearing to leaving in the video as a track. Each track has an id, and the
information of the same track represents one person.
7/25/2019 Koala API V3.1.0
Koala API V3.1.0
There are three possible processes for algorithm processing:
Field Type Description
screen Screen Information identifying the location, available only if type is not gone
person Person Person similar to the one shown in the library, available only when the type is recognized
open_door bool Whether the door is opened, available only when the type is recognized
error string If open_door is false, this field indicates the reason why the door cannot be opened.
type string The type of this information, four types are available: lastface (recognizing), recognized,
unrecognized and gone.
data RecognizeInfo
The underlying information identified by the algorithm. No action needs to be taken if not
necessary. The “track” here indicates track id. Age and gender information will be included here only
when the type is gone.
recognizing...recognizing...gone
○ recognizing...recognizing...recognized,gone
○ recognizing...recognizing...unrecognized,gone
For changes in the values in the data of firmware later than version 2.8:
The value of status changes from a string to a dictionary
'status': {
'recognize_status’:’not_determined’,
'snapshot_status': 'ongoing'
}
Available values for recognize_status include stranger, t_determined, and recognized, respectively, indicating stranger, unknown and recognized,
respectively.
Available values for snapshot_status include ongoing and gone. If it is ongoing, the program sends the real-time face calculation result. If the
recognize_status is not t_determined, it indicates that the judgment has been completed, and the program will not send the subsequent real-time face
calculation result. If it is gone, it means that the track has been completed. The program will send the calculation results of the highest-quality human face.
feature_id is added to person. It is not in use at the moment and its value is fixed at 0.
Since foliage will delay (until the end of track) sending attr separately, the attr field is canceled in the recognition message.
#####Person (fields without a description are the same as those in subject)
| Field | Type | Description |
| :--| :--| :--|
| src | base64 image | Image captured in real time |