0% found this document useful (0 votes)
9 views41 pages

Mag Me-Acs Web API Application Note v1.8

The MAG ETEGRA Software API Application Note provides detailed information about the API endpoints available for managing departments, designations, branches, doors, users, and time zones. It includes a revision history, API endpoint details, and sample responses for various operations. The latest version, 1.8, was released on 19 October 2023, with updates to several API endpoints.

Uploaded by

vnpsjxj8dg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views41 pages

Mag Me-Acs Web API Application Note v1.8

The MAG ETEGRA Software API Application Note provides detailed information about the API endpoints available for managing departments, designations, branches, doors, users, and time zones. It includes a revision history, API endpoint details, and sample responses for various operations. The latest version, 1.8, was released on 19 October 2023, with updates to several API endpoints.

Uploaded by

vnpsjxj8dg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Application Note

Software API
WWW.MAG-ETEGRA.COM.MY
MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Version: V1.6

Release date: 10 October 2023

Document Revision History

Version No Date Summary of Revisions


0.1 6 June 2023 Initial creation
0.2 7 June 2023 Added API Endpoints for
Departments, Designation,
Branches, Doors and Users
0.3 8 June 2023 Added API Endpoints for
Time zones, Update face and Update
face permissions
0.4 19 June 2023 Updated API Endpoints
0.5 21 June 2023 Added API Endpoint for Upload user
0.6 22 June 2023 Added API Endpoint for Set door
0.7 28 June 2023 Added API Endpoint for Get events
0.8 12 July 2023 Updated API Endpoint Host
0.9 8 August 2023 Added API Endpoint for Get door
groups, Update door group and
Upload door group
1.0 9 August 2023 Updated API Endpoint for Update
face permissions, Get time zones and
Update time zone
1.1 10 August 2023 Added API Endpoint for Delete door
group and Delete time zone
1.2 11 August 2023 Added API Endpoint for Upload time
zone
1.3 29 August 2023 Updated API Endpoint for Update
face permissions
1.4 1 September 2023 Updated API Endpoint for Get events

1.5 7 September 2023 Added API Endpoint for Delete user

1.6 10 October 2023 Added API Endpoint for Get user, Get
face and Get list of user id
1.7 17 October 2023 Added API Endpoint for Get face
permissions

© 2023 ME-ACS Software API 2


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Updated API Endpoint for Update


face permissions
1.8 19 October 2023 Updated API Endpoint for Get face
from device

© 2023 ME-ACS Software API 3


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

API Endpoint Host


http://localhost:5005

API Endpoints
Departments
Get departments GET

Designations
Get designations GET

Branches
Get branches GET

Doors
Get doors GET

Door Groups
Get door groups GET
Update door group POST
Delete door group DELETE

Time zones
Get time zones GET
Update time zone POST
Delete time zone DELETE

Users
Create user POST
Update user PUT
Delete user DELETE
Set face PUT
Get face GET
Update face permissions PUT
Get face permissions GET
Delete face DELETE
Get user GET
Get list of user id GET

Devices
Upload user POST
Set door POST

© 2023 ME-ACS Software API 4


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Upload door group POST


Upload time zone POST
Delete user POST
Get face from device PUT

Events
Get events GET

© 2023 ME-ACS Software API 5


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Get departments
HTTP Method: GET
URL: /api/departments
Description: Returns a list of all departments

Sample Responses:
200 OK
[
{
"id": 1,
"name": "Account"
},
{
"id": 2,
"name": "IT"
}
]

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
id Department id
name Department name

© 2023 ME-ACS Software API 6


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Get designations
HTTP Method: GET
URL: /api/designations
Description: Returns a list of all designations

Sample Responses:
200 OK
[
{
"id": 1,
"name": "Visitor"
},
{
"id": 2,
"name": "Contractor"
}
]

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
id Designation id
name Designation name

© 2023 ME-ACS Software API 7


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Get branches
HTTP Method: GET
URL: /api/branches
Description: Returns a list of all branches

Sample Responses:
200 OK
[
{
"id": 1,
"name": "HQ"
},
{
"id": 2,
"name": "JB"
}
]

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
id Branch id
name Branch name

© 2023 ME-ACS Software API 8


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Get doors
HTTP Method: GET
URL: /api/doors
Description: Returns a list of all doors

Sample Responses:
200 OK
[
{
"door_id": "1.0.1",
"door_status": 0
},
{
"door_id": "1.0.2",
"door_status": 1
},
{
"door_id": "1.0.4",
"door_status": 2
}
]

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
door_id Door id
door_status Door status
Valid values are:
• 0: Offline
• 1: Online
• 2: Disabled

© 2023 ME-ACS Software API 9


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Get door groups


HTTP Method: GET
URL: /api/doorgroups
Description: Returns a list of all door groups

Sample Responses:
200 OK
[
{
"id": 1,
"name": "DG1",
"doors": [
"6.0.1"
]
},
{
"id": 2,
"name": "DG2",
"doors": [
"1.0.11",
"1.0.12"
]
}
]

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
id Door group id
name Door group name
doors List of doors

© 2023 ME-ACS Software API 10


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Update door group


HTTP Method: POST
URL: /api/doorgroups
Description: Updates door group

Request Parameters:
Parameter Name Description Required Type
group_name Door group name Y string
group_doors List of doors N string array

Request Body:
{
"group_name": "Account",
"group_doors": [
"7.0.1",
"7.0.3"
]
}

Sample Responses:
204 No Content

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

© 2023 ME-ACS Software API 11


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Delete door group


HTTP Method: DELETE
URL: /api/doorgroups/{name}
Description: Deletes a door group

Resource Parameter:
Parameter Name Description Required Type
name Door group name Y string

Sample Responses:
204 No Content

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

© 2023 ME-ACS Software API 12


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Get time zones


HTTP Method: GET
URL: /api/timezones
Description: Returns a list of all time zones

Sample Responses:
200 OK
[
{
"id": 1,
"name": "TZ1",
"sun_allowed": false,
"sun_start": "00:00:00",
"sun_end": "00:00:00",
"mon_allowed": true,
"mon_start": "16:05:00",
"mon_end": "16:10:00",
"tue_allowed": false,
"tue_start": "00:00:00",
"tue_end": "00:00:00",
"wed_allowed": false,
"wed_start": "00:00:00",
"wed_end": "00:00:00",
"thu_allowed": false,
"thu_start": "00:00:00",
"thu_end": "00:00:00",
"fri_allowed": false,
"fri_start": "00:00:00",
"fri_end": "00:00:00",
"sat_allowed": false,
"sat_start": "00:00:00",
"sat_end": "00:00:00",
"holiday_allowed": false
}
]

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
id Time zone id
name Time zone name
sun_allowed Allowed to enter on Sunday

© 2023 ME-ACS Software API 13


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

sun_start Start time


sun_end End time
mon_allowed Allowed to enter on Monday
mon_start Start time
mon_end End time
tue_allowed Allowed to enter on Tuesday
tue_start Start time
tue_end End time
wed_allowed Allowed to enter on Wednesday
wed_start Start time
wed_end End time
thu_allowed Allowed to enter on Thursday
thu_start Start time
thu_end End time
fri_allowed Allowed to enter on Friday
fri_start Start time
fri_end End time
sat_allowed Allowed to enter on Saturday
sat_start Start time
sat_end End time
holiday_allowed Allowed to enter during holiday

© 2023 ME-ACS Software API 14


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Update time zone


HTTP Method: POST
URL: /api/timezones
Description: Updates time zone

Request Parameters:
Parameter Name Description Required Type
name Time zone name Y string
sun_allowed Allowed to enter on Sunday Y boolean
sun_start Start time Y timespan
sun_end End time Y timespan
mon_allowed Allowed to enter on Monday Y boolean
mon_start Start time Y timespan
mon_end End time Y timespan
tue_allowed Allowed to enter on Tuesday Y boolean
tue_start Start time Y timespan
tue_end End time Y timespan
wed_allowed Allowed to enter on Wednesday Y boolean
wed_start Start time Y timespan
wed_end End time Y timespan
thu_allowed Allowed to enter on Thursday Y boolean
thu_start Start time Y timespan
thu_end End time Y timespan
fri_allowed Allowed to enter on Friday Y boolean
fri_start Start time Y timespan
fri_end End time Y timespan
sat_allowed Allowed to enter on Saturday Y boolean
sat_start Start time Y timespan
sat_end End time Y timespan
holiday_allowed Allowed to enter during holiday Y boolean

Request Body:
{
"name": "TZ1",
"sun_allowed": false,
"sun_start": "00:00:00",
"sun_end": "00:00:00",
"mon_allowed": true,
"mon_start": "16:05:00",
"mon_end": "16:10:00",
"tue_allowed": false,
"tue_start": "00:00:00",
"tue_end": "00:00:00",
"wed_allowed": false,
"wed_start": "00:00:00",
"wed_end": "00:00:00",
"thu_allowed": false,
"thu_start": "00:00:00",
© 2023 ME-ACS Software API 15
MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

"thu_end": "00:00:00",
"fri_allowed": false,
"fri_start": "00:00:00",
"fri_end": "00:00:00",
"sat_allowed": false,
"sat_start": "00:00:00",
"sat_end": "00:00:00",
"holiday_allowed": false
}

Sample Responses:
204 No Content

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

© 2023 ME-ACS Software API 16


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Upload time zone


HTTP Method: POST
URL: /api/devices/uploadtimezone
Description: Uploads time zone

Request Parameters:
Parameter Name Description Required Type
doors List of doors Y string array

Request Body:
{
"doors": [
"7.0.3"
]
}

Sample Responses:
200 OK
[
{
"door_id": "7.0.3",
"error": false,
"message": "Success"
}
]

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
door_id Door id
error Valid values are:
true: failure
false: success
message Upload status message

© 2023 ME-ACS Software API 17


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Delete time zone


HTTP Method: DELETE
URL: /api/timezones/{name}
Description: Deletes a time zone

Resource Parameter:
Parameter Name Description Required Type
name Time zone name Y string

Sample Responses:
204 No Content

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

© 2023 ME-ACS Software API 18


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Create user
HTTP Method: POST
URL: /api/users
Description: Creates a new user

Request Parameters:
Parameter Name Description Required Type
user_id User id Y string
user_name Name Y string
designation Designation Y integer
department Department Y integer
branch Branch N integer
guard_patrol Guard patrol N boolean
skip_fp Skip fingerprint check N boolean
skip_card Skip card check N boolean
exp_end_enabled Enable expiry ending date Y boolean
exp_end_date Expiry ending date N string/date
exp_start_enabled Enable start valid date Y boolean
exp_start_date Start valid date N string/date
alias Alias N string
car_id Car id N string
legal_id Legal id N string
address_1 Address 1 N string
address_2 Address 2 N string
address_3 Address 3 N string
address_4 Address 4 N string
tel_no Tel N string
mobile_no Mobile N string
email Email N string
gender Gender N string
Valid values are:
• Blank
• M: Male
• F: Female
birth_date Birth date N string/date
start_date Start date N string/date
is_admin Admin control for Face Reader Menu N boolean

Request Body:
{
"user_id": "TESTER001",
"user_name": "TESTER 1",
"department": 2,
"designation": 1,
"branch_id": 1,
"guard_patrol": true,
"skip_fp": true,
"skip_card": true,
"exp_end_enabled": true,

© 2023 ME-ACS Software API 19


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API
"exp_end_date": "2033-06-01T08:41:53.241Z",
"exp_start_enabled": true,
"exp_start_date": "2023-06-01T08:41:53.241Z",
"alias": "",
"car_id": "",
"legal_id": "",
"address_1": "",
"address_2": "",
"address_3": "",
"address_4": "",
"tel_no": "",
"mobile_no": "",
"email": "",
"gender": "",
"birth_date": "2003-06-19T08:41:53.241Z",
"start_date": "2023-06-19T08:41:53.241Z",
"is_admin": true
}

Sample Responses:
201 Created
Response Headers
content-length: 0
date: Mon,19 Jun 2023 08:48:52 GMT
location: https://localhost/api/users/tester001
server: Kestrel

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

© 2023 ME-ACS Software API 20


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Update user
HTTP Method: PUT
URL: /api/users/{id}
Description: Updates a user

Resource Parameter:
Parameter Name Description Required Type
id User id Y string

Request Parameters:
Parameter Name Description Required Type
user_name Name Y string
designation Designation Y integer
department Department Y integer
branch Branch N integer
guard_patrol Guard patrol N boolean
skip_fp Skip fingerprint check N boolean
skip_card Skip card check N boolean
exp_end_enabled Enable expiry ending date Y boolean
exp_end_date Expiry ending date N string/date
exp_start_enable Enable start valid date Y boolean
d
exp_start_date Start valid date N string/date
alias Alias N string
car_id Car id N string
legal_id Legal id N string
address_1 Address 1 N string
address_2 Address 2 N string
address_3 Address 3 N string
address_4 Address 4 N string
tel_no Tel N string
mobile_no Mobile N string
email Email N string
gender Gender N string
Valid values are:
• Blank
• M: Male
• F: Female
birth_date Birth date N string/date
start_date Start date N string/date
is_admin Admin control for Face Reader Menu N boolean

Request Body:
{
"user_name": "TESTER 1",
"department": 2,
"designation": 1,
"branch_id": 1,

© 2023 ME-ACS Software API 21


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API
"guard_patrol": true,
"skip_fp": true,
"skip_card": true,
"exp_end_enabled": true,
"exp_end_date": "2033-06-01T08:41:53.241Z",
"exp_start_enabled": true,
"exp_start_date": "2023-06-01T08:41:53.241Z",
"alias": "",
"car_id": "",
"legal_id": "",
"address_1": "",
"address_2": "",
"address_3": "",
"address_4": "",
"tel_no": "",
"mobile_no": "",
"email": "",
"gender": "",
"birth_date": "2003-06-19T08:41:53.241Z",
"start_date": "2023-06-19T08:41:53.241Z",
"is_admin": true
}

Sample Responses:
200 OK
{
"user_id": "TESTER001",
"user_name": "TESTER 1",
"department": 2,
"designation": 1,
"branch": null,
"guard_patrol": true,
"skip_fp": true,
"skip_card": true,
"exp_end_enabled": true,
"exp_end_date": "2033-06-01T08:41:53.241Z",
"exp_start_enabled": true,
"exp_start_date": "2023-06-01T08:41:53.241Z",
"alias": "",
"car_id": "",
"legal_id": "",
"address_1": "",
"address_2": "",
"address_3": "",
"address_4": "",
"tel_no": "",
"mobile_no": "",
"email": "",
"gender": "",
"birth_date": "2003-06-19T08:41:53.241Z",
"start_date": "2023-06-19T08:41:53.241Z",
"is_admin": true,
"created_by": "ADMIN",
"date_created": "2023-06-19T16:43:54.36",
"modified_by": "ADMIN",
"date_modified": "2023-06-19T17:07:14.802236+08:00"
}

© 2023 ME-ACS Software API 22


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

© 2023 ME-ACS Software API 23


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Set face
HTTP Method: PUT
URL: /api/users/{id}/set_face
Description: Updates face

Resource Parameter:
Parameter Name Description Required Type
id User id Y string

Request Parameter:
Parameter Name Description Required Type
file_bytes The image file to upload Y byte array
File type: jpg
Recommended image size: 480 x 640

Request Body:
{
"file_bytes":
"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAB2AAAAdgFOeyYIAAAAGXRFWHRTb2Z0d
2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAOpJREFUOI2t0ktKQ0EQheHPO5AsQhBBguAKfEzENYi4BAm4B92CuAg
1F1xB3IEx4gocGo2KI/GBgy6DXPtqDzzQgz5d9Vd1d5FXF3084wk1Flpif2gJ97jCHnZxEV4RpI7kzjevgyFOSwB3U
bmpHh6aZpUJnMVrC/yjpINaunPzCpc4LgF0pQcbSg/Yi+QxFksAMBfVHiPxJMD/r5kWfx5bWI79tfSFN38BKxzgBbc
YxBqHty//c1MdYYLtRmCFHWkODtuSN/GGlV8KrOMdG7nDM2WjWseatvalVZwXAAZYywEmGBUARtJ8gE9LJjMHnxa8C
wAAAABJRU5ErkJggg=="
}

Sample Responses:
204 No Content

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

© 2023 ME-ACS Software API 24


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Get face
HTTP Method: GET
URL: /api/users/{id}/get_face
Description: Gets face

Resource Parameter:
Parameter Name Description Required Type
id User id Y string

Request Body:
Sample Responses:
200 OK
{
"file_bytes":
"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAB2AAAAdgFOeyYIAAAAGXRFWHRTb2Z0d
2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAOpJREFUOI2t0ktKQ0EQheHPO5AsQhBBguAKfEzENYi4BAm4B92CuAg
1F1xB3IEx4gocGo2KI/GBgy6DXPtqDzzQgz5d9Vd1d5FXF3084wk1Flpif2gJ97jCHnZxEV4RpI7kzjevgyFOSwB3U
bmpHh6aZpUJnMVrC/yjpINaunPzCpc4LgF0pQcbSg/Yi+QxFksAMBfVHiPxJMD/r5kWfx5bWI79tfSFN38BKxzgBbc
YxBqHty//c1MdYYLtRmCFHWkODtuSN/GGlV8KrOMdG7nDM2WjWseatvalVZwXAAZYywEmGBUARtJ8gE9LJjMHnxa8C
wAAAABJRU5ErkJggg=="
}

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
file_bytes The image file
File type: jpg

© 2023 ME-ACS Software API 25


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Update face permissions


HTTP Method: PUT
URL: /api/permissions/{id}/set_face
Description: Updates face permissions

Resource Parameter:
Parameter Name Description Required Type
id User id Y string

Request Parameters:
Parameter Name Description Required Type
access_mode Access mode Y integer
Valid values are:
0: Invalid access
1: Normal access
door_group Door group name N string
*Door vs time zone must be empty
*Lift door vs floor must be empty
timezone Time zone name N string
NULL or EMPTY: Free zone
*Door vs time zone must be empty
*Lift door vs floor must be empty
doors_vs_timezones Door vs time zone N refer to
*Door group must be empty Door vs
*Time zone must be empty time zone
Parameters
doors_vs_floors Lift door vs floor N refer to Lift
*Door group must be empty door vs
*Time zone must be empty floor
Parameters
site_code Site code N string
*ABA number must be empty
*Card code will be required field if site code has value
card_code Card code N string
*ABA number must be empty
*Site code will be required field if card code has value
aba_number ABA number N string
*Site code and card code must be empty

Door vs time zone Parameters:


Parameter Name Description Required Type
door_id Door id Y string
timezone Time zone name N string
NULL or EMPTY: Free zone

Lift door vs floor Parameters:


Parameter Name Description Required Type
door_id Door id Y string
© 2023 ME-ACS Software API 26
MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

floors Floor id Y int array


Valid values are:
1 to 64

Request Body:
{
"access_mode": 1,
"doors_vs_timezones": [
{
"door_id": "7.0.1"
},
{
"door_id": "1.0.2",
"timezone": "TZ2"
}
],
"doors_vs_floors": [
{
"door_id": "1.0.1",
"floors": [1, 2, 3]
}
],
"site_code": "123",
"card_code": "456",
}

Sample Responses:
204 No Content

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

© 2023 ME-ACS Software API 27


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Get face permissions


HTTP Method: GET
URL: /api/permissions/{id}/get_face
Description: Gets face permissions

Resource Parameter:
Parameter Name Description Required Type
id User id Y string

Request Body:
Sample Responses:
200 OK
{
"access_mode": 1,
"door_group": null,
"timezone": null,
"doors_vs_floors": [
{
"door_id": "7.0.1",
"floors": [
1,
2,
3
]
}
],
"doors_vs_timezones": [
{
"door_id": "7.0.1",
"timezone": null
},
{
"door_id": "7.0.2",
"timezone": "TZ2"
}
],
"site_code": "100",
"card_code": "12345",
"aba_number": "0006565945"
}

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"

© 2023 ME-ACS Software API 28


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API
}

Response Fields:
Parameter Name Description
access_mode Access mode
Valid values are:
0: Invalid access
1: Normal access
door_group Door group name
timezone Time zone name
NULL or EMPTY: Free zone
doors_vs_timezones Door vs time zone

doors_vs_floors Lift door vs floor

site_code Site code


card_code Card code

aba_number ABA number

© 2023 ME-ACS Software API 29


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Delete user
HTTP Method: DELETE
URL: /api/users/{id}
Description: Deletes a user (including face and permissions)

Resource Parameter:
Parameter Name Description Required Type
id User id Y string

Sample Responses:
204 No Content

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

© 2023 ME-ACS Software API 30


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Delete face
HTTP Method: DELETE
URL: /api/users/{id}/delete_face
Description: Deletes a face

Resource Parameter:
Parameter Name Description Required Type
id User id Y string

Sample Responses:
204 No Content

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

© 2023 ME-ACS Software API 31


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Get user
HTTP Method: GET
URL: /api/users/{id}
Description: Gets user details

Resource Parameter:
Parameter Name Description Required Type
id User id Y string

Sample Responses:
200 OK
{
"user_id": "TESTER001",
"user_name": "TESTER 1",
"department": 0,
"designation": 0,
"branch": null,
"guard_patrol": false,
"skip_fp": false,
"skip_card": true,
"exp_end_enabled": false,
"exp_end_date": "2033-06-01T00:00:00",
"exp_start_enabled": false,
"exp_start_date": "2023-06-01T00:00:00",
"alias": null,
"car_id": null,
"legal_id": null,
"address_1": null,
"address_2": null,
"address_3": null,
"address_4": null,
"tel_no": null,
"mobile_no": null,
"email": null,
"gender": "",
"birth_date": "2022-06-16T00:00:00",
"start_date": "2022-06-16T00:00:00",
"is_admin": false,
"created_by": "ADMIN",
"date_created": "2022-06-16T19:10:43",
"modified_by": "ADMIN",
"date_modified": "2023-04-16T19:03:17.38"
}

© 2023 ME-ACS Software API 32


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
user_id User id
user_name Name
designation Designation
department Department
branch Branch
guard_patrol Guard patrol
skip_fp Skip fingerprint check
skip_card Skip card check
exp_end_enabled Enable expiry ending date
exp_end_date Expiry ending date
exp_start_enabled Enable start valid date
exp_start_date Start valid date
alias Alias
car_id Car id
legal_id Legal id
address_1 Address 1
address_2 Address 2
address_3 Address 3
address_4 Address 4
tel_no Tel
mobile_no Mobile
email Email
gender Gender
Valid values are:
• Blank
• M: Male
• F: Female
birth_date Birth date
start_date Start date
is_admin Admin control for Face Reader Menu

© 2023 ME-ACS Software API 33


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Get list of user id


HTTP Method: GET
URL: /api/users/useridlist
Description: Returns a list of all users (in user id)

Sample Responses:
200 OK
[
"TESTER001",
"TESTER002",
"TESTER003"
]

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

© 2023 ME-ACS Software API 34


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Upload user
HTTP Method: POST
URL: /api/devices/uploaduser
Description: Uploads user

Request Parameters:
Parameter Name Description Required Type
users List of users Y string array
doors List of doors Y string array

Request Body:
{
"users": [
"8"
],
"doors": [
"7.0.3"
]
}

Sample Responses:
200 OK
[
{
"door_id": "7.0.3",
"user_id": "8",
"error": false,
"message": "Success"
}
]

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
door_id Door id
user_id User id
error Valid values are:
true: failure
false: success
message Upload status message

© 2023 ME-ACS Software API 35


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Set door
HTTP Method: POST
URL: /api/devices/setdoor
Description: Locks or unlocks door

Request Parameters:
Parameter Name Description Required Type
door_id Door id Y string
door_command Door command Y int
Valid values are:
0: unlock
1: lock

Request Body:
{
"door_id": "7.0.3",
"door command": 0
}

Sample Responses:
200 OK
{
"door_id": "7.0.3",
"door_status": 0
}

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
door_id Door id
door_status Door status
0: unlocked
1: locked

© 2023 ME-ACS Software API 36


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Upload door group


HTTP Method: POST
URL: /api/devices/uploaddoorgroup
Description: Uploads door group

Request Parameters:
Parameter Name Description Required Type
doors List of doors Y string array

Request Body:
{
"doors": [
"7.0.3"
]
}

Sample Responses:
200 OK
[
{
"door_id": "7.0.3",
"error": false,
"message": "Success"
}
]

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
door_id Door id
error Valid values are:
true: failure
false: success
message Upload status message

© 2023 ME-ACS Software API 37


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Delete user
HTTP Method: POST
URL: /api/devices/deleteuser
Description: Uploads user

Request Parameters:
Parameter Name Description Required Type
users List of users Y string array
doors List of doors Y string array

Request Body:
{
"users": [
"8"
],
"doors": [
"7.0.3"
]
}

Sample Responses:
200 OK
[
{
"door_id": "7.0.3",
"user_id": "8",
"error": false,
"message": "Success"
}
]

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
door_id Door id
user_id User id
error Valid values are:
true: failure
false: success
message Upload status message

© 2023 ME-ACS Software API 38


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Get face from device


HTTP Method: PUT
URL: /api/devices/get_face/{id}/{door_id}
Description: Synchronizes and gets face from the reader

Request Parameters:
Parameter Name Description Required Type
id User id Y string
door_id Door id Y string

Sample Responses:
200 OK
{
"file_bytes":
"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAB2AAAAdgFOeyYIAAAAGXRFWHRTb2Z0d
2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAOpJREFUOI2t0ktKQ0EQheHPO5AsQhBBguAKfEzENYi4BAm4B92CuAg
1F1xB3IEx4gocGo2KI/GBgy6DXPtqDzzQgz5d9Vd1d5FXF3084wk1Flpif2gJ97jCHnZxEV4RpI7kzjevgyFOSwB3U
bmpHh6aZpUJnMVrC/yjpINaunPzCpc4LgF0pQcbSg/Yi+QxFksAMBfVHiPxJMD/r5kWfx5bWI79tfSFN38BKxzgBbc
YxBqHty//c1MdYYLtRmCFHWkODtuSN/GGlV8KrOMdG7nDM2WjWseatvalVZwXAAZYywEmGBUARtJ8gE9LJjMHnxa8C
wAAAABJRU5ErkJggg=="
}

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
file_bytes The image file
File type: jpg

© 2023 ME-ACS Software API 39


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

Get events
HTTP Method: GET
URL: /api/events
Description: Returns a list of events

Request Parameters:
Parameter Name Description Required Type
start Start datetime Y string/datetime
end End datetime Y string/datetime
user_id User id N string

Sample Responses:
200 OK
[
{
"id": 535391,
"time": "2023-06-21T11:04:18",
"user_id": "8",
"user_name": "Marcus",
"department ": "Account",
"door_id": "7.0.3",
"door_name": "7.0.3 - FR320",
"event": "Normal access by face"
}
]

500 Internal Server Error


{
"error": true,
"code": 500,
"message": "An unknown error occurred"
}

Response Fields:
Parameter Name Description
id Event id
time Event date time
user_id User id
user_name User name
department Department
door_id Door id
door_name Door name
event Event description

© 2023 ME-ACS Software API 40


MAG APPLICATION NOTE - MAG ETEGRA SOFTWARE API

*Product performances is based on testing in a controlled environment. Your result may vary due
to several external and environment factors.

©COPYRIGHT 2023.This documentation served as a reference only. It is subject to change without further notice. All the diagrams and information
in this documentation may not be duplicated or modified in any form without the written approval from the management.

© 2023 ME-ACS Software API 41

You might also like