0% found this document useful (0 votes)
13 views31 pages

UTimeMaster API User Manual

The document outlines the UTimeMaster API, detailing various authentication methods and endpoints for managing system users, staff, devices, employees, departments, areas, positions, and transactions. It includes instructions for obtaining authentication tokens, as well as API calls for creating, updating, and retrieving information related to employees and devices. The document serves as a comprehensive guide for integrating third-party systems with UTimeMaster's platform data.

Uploaded by

gtapias
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)
13 views31 pages

UTimeMaster API User Manual

The document outlines the UTimeMaster API, detailing various authentication methods and endpoints for managing system users, staff, devices, employees, departments, areas, positions, and transactions. It includes instructions for obtaining authentication tokens, as well as API calls for creating, updating, and retrieving information related to employees and devices. The document serves as a comprehensive guide for integrating third-party systems with UTimeMaster's platform data.

Uploaded by

gtapias
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

Content

1. API Description.................................................................................................................................................................2

2. Get System User Auth Token..........................................................................................................................................3

2.1 Get JWT Auth Token................................................................................................................................................ 3

2.2 Get General auth token............................................................................................................................................4

3. Get Staff Auth Token....................................................................................................................................................... 6

3.1 Staff JWT auth token................................................................................................................................................ 6

3.2 Get staff General Auth Token.................................................................................................................................. 6

4. Use Auth Token................................................................................................................................................................ 6

4.1 Demo 1..................................................................................................................................................................... 6

4.2 Demo 2 (with Third Party Tool - Postman)..............................................................................................................7

5. Device API......................................................................................................................................................................... 8

5.1 Get Device List API................................................................................................................................................... 8

5.2 Get Device Object Info API.................................................................................................................................... 10

6. Employee API..................................................................................................................................................................11

6.1 Get Employee List API............................................................................................................................................ 11

6.2 Get Employee Object Info API............................................................................................................................... 14

6.3 Create Employee API..............................................................................................................................................15

6.4 Update Employee API............................................................................................................................................ 17

6.5 Delete Employee API............................................................................................................................................. 19

7. Department API..............................................................................................................................................................20
7.1 Get Department List API........................................................................................................................................ 20

7.2 Get Department Object Info API........................................................................................................................... 21

7.3 Create Department API..........................................................................................................................................21

7.4 Update Department API........................................................................................................................................ 22

7.5 Delete Department API..........................................................................................................................................22

8. Area API........................................................................................................................................................................... 23

8.1 Get Area List API.....................................................................................................................................................23

8.2 Get Area Object Info API........................................................................................................................................ 24

8.3 Create Area API...................................................................................................................................................... 24

8.4 Update Area API..................................................................................................................................................... 25

8.5 Delete Area API...................................................................................................................................................... 26

9. Position API.....................................................................................................................................................................26

9.1 Get Position List API............................................................................................................................................... 26

9.2 Get Position Object Info API.................................................................................................................................. 27

9.3 Create Position API.................................................................................................................................................28

9.4 Update Position API............................................................................................................................................... 28

9.5 Delete Position API.................................................................................................................................................29

10. Transaction API............................................................................................................................................................ 30

10.1 Get Transaction List API.......................................................................................................................................30


1. API Description

UTimeMaster API is dedicated to the platform data connection for the third-party system. The third-party

system can read and set business data flexibly, which effectively reduces the complexity of the third-party

system business integration and provides convenient, fast standard connection mode and data structure.

2. Get System User Auth Token

There are two kinds of auth token for software system user : JWT auth token and general auth token.
2.1 Get JWT Auth Token
(1) Request Instruction

HTTPS Method POST

URI /jwt-api-token-auth/

Content Type application/json

Response Type JSON

Parameter Description username: string, is required, the username to login the system.

password: string, is required, the password to login the system.

{
Request Herders "Content-Type":"application/json"
}

{
"username":"username",
Request Body
"password":"pwd"
}

(2) How to Get Token


1) Get token via browser,input the following link in the browser:
[Link]
serverIP : UTimeMaster server or computer IP, such as:
[Link]; serverPort : The server port of UTimeMaster , such
as: 8090;
2) Get token via third-party, such as Postman.

2.2 Get General auth token


(1) Request Instruction
Same as getting JWT Token
(2) How to Get Token
1) Get token via browser,input the following link in the browser:
[Link]
serverIP : UTimeMaster server or computer IP, such as:
[Link]; serverPort : The server port of UTimeMaster 9.0,
such as: 8090;

2) Get token via third-party API development tool, such as Postman.


3. Get Staff Auth Token

3.1 Staff JWT auth token


URL: [Link]
serverIP : UTimeMaster server or computer IP;
serverPort : The server port of UTimeMaster 9.0;

The way to get token is the same as JWT token above.

3.2 Get staff General Auth Token


URL: [Link]
serverIP : UTimeMaster server or computer IP;
serverPort : The server port of UTimeMaster 9.0;

The way to get token is the same as JWT token above.

4. Use Auth Token


4.1 Demo 1
Request URL [Link]

JWT Token

{
"Content-Type":"application/json",
"Authorization":"JWT ey.........oQi98"
}
Request Herders General Token

{
"Content-Type":"application/json",
"Authorization":"Token
ae600ca0f1d0aeed8af3f93c8530a69c714752b7"
}

"count": 0,

"next": null,

"previous": null,

Response Content "msg": "",

"code": 0,

"results": [],

"data": []

4.2 Demo 2 (with Third Party Tool - Postman)


(1) Use General Token (same way to use JWT token)
5. Device API
5.1 Get Device List API

HTTP Method GET

URI /iclock/api/terminals/

Data Type application/json

Response Type JSON

[Link]
as=**&area=**
Request Address
sn, page, limit, alias , area are optional filter field, use & as connector

While the request address without any filter field, you will get all devices list.

Example:

Request Address:

Response JSON Format [Link]

Response:

{
"count": 1,

"next": null,

"previous": null,

"msg": "",

"code": 0,

"data": [

"id": 1,

"sn": "ACEZ185060382",

"ip_address": "[Link]",

"alias": "ACEZ185060382_name",

"terminal_name": null,

"fw_ver": null,

"push_ver": "",

"state": 1,

"terminal_tz": 8,

"area": {

"id": 1,

"area_code": "1",

"area_name": "Not Authorized"

},

"last_activity": null,

"user_count": null,

"fp_count": null,

"face_count": null,

"palm_count": null,

"transaction_count": null,

"push_time": null,

"transfer_time": "00:00;14:05",

"transfer_interval": 10,

"is_attendance": true,
"area_name": "Not Authorized"

5.2 Get Device Object Info API

HTTP Method GET

URI /iclock/api/terminals/ <id>/

Data Type application/json

Response Type JSON

Request Address [Link] id/

Example:

Request Address: [Link]

Response:

"id": 1,

"sn": "ACEZ185060382",

"ip_address": "[Link]",

"alias": "ACEZ185060382_name",

Response JSON Format "terminal_name": null,

"fw_ver": null,

"push_ver": "",

"state": 1,

"terminal_tz": 8,

"area": {

"id": 1,

"area_code": "1",

"area_name": "Not Authorized"


},

"last_activity": null,

"user_count": null,

"fp_count": null,

"face_count": null,

"palm_count": null,

"transaction_count": null,

"push_time": null,

"transfer_time": "00:00;14:05",

"transfer_interval": 10,

"is_attendance": true,

"area_name": "Not Authorized"

6. Employee API

6.1 Get Employee List API

HTTP Method GET

URI /personnel/api/employees/

Data Type application/json

Response Type JSON

[Link]
&first_name=**&last_name=**&department=**&app_status=**
Request Address
page, limit, emp_code, first_name, last_name, department, app_status are
optional filter fields.

Example:

Request Address:
Response JSON Format
[Link]

Response:
{

"count": 1,

"next": null,

"previous": null,

"msg": "",

"code": 0,

"data": [

"id": 5,

"emp_code": "employee1",

"first_name": "emp1_first_name",

"last_name": "emp1_last_name",

"nickname": "",

"device_password": "",

"card_no": "",

"department": {

"id": 1,

"dept_code": "1",

"dept_name": "Department"

},

"dept_name": "Department",

"position": null,

"position_name": null,

"hire_date": "2019-04-02",

"gender": "",

"birthday": null,

"verify_mode": null,

"emp_type": null,

"contact_tel": "",

"office_tel": "",

"mobile": "",
"national": "",

"city": "",

"address": "",

"postcode": "",

"email": "",

"enroll_sn": "",

"ssn": "",

"religion": "",

"enable_att": false,

"enable_overtime": false,

"enable_holiday": false,

"dev_privilege": null,

"self_password":
"pbkdf2_sha256$36000$XIJACl8JIXWA$a4hztrK8RSMjBgd9sWL3lTMQS3O9M
z+QwaGU/RBiXRU=",

"flow_role": [],

"area": [

"id": 1,

"area_code": "1",

"area_name": "Not Authorized"

],

"area_name": "Not Authorized",

"app_status": 0,

"app_role": null

}
6.2 Get Employee Object Info API

HTTP Method GET

URI /personnel/api/employees/ <id>/

Data Type application/json

Response Type JSON

Request Address [Link] ID/

Example:

Request Address: [Link]

Response:

"emp_code": "employee333",

"first_name": "emp3_first_name",

"last_name": "emp3_last_name",

"nickname": null,

"device_password": null,

"card_no": null,

"department": 1,
Response JSON Format
"position": null,

"hire_date": "2019-04-02",

"gender": null,

"birthday": null,

"verify_mode": -1,

"emp_type": null,

"contact_tel": null,

"office_tel": null,

"mobile": null,

"national": null,

"city": null,
"address": null,

"postcode": null,

"email": null,

"enroll_sn": null,

"ssn": null,

"religion": null,

"enable_att": true,

"enable_overtime": false,

"enable_holiday": true,

"dev_privilege": 1,

"self_password":
"pbkdf2_sha256$36000$XBVRNMOywdNI$P4W7MIZVa3Ho2VBdU2SewS/pb8
GavBYSGBXM/bgL+N0=",

"flow_role": [],

"area": [

],

"app_status": 0,

"app_role": 1

6.3 Create Employee API

HTTP Method POST

URI /personnel/api/employees/

Data Type application/json

Response Type JSON

Request Parameter Reference: [Link]

Request Address:

Response JSON Format [Link]

Request Body:
{

"emp_code": "employee333",

"first_name": "emp3_first_name",

"last_name": "emp3_last_name",

"area": [1],

"department": 1

Response Data:

"id": 6,

"emp_code": "employee333",

"first_name": "emp3_first_name",

"last_name": "emp3_last_name",

"nickname": null,

"device_password": null,

"card_no": null,

"department": {

"id": 1,

"dept_code": "1",

"dept_name": "Department"

},

"dept_name": "Department",

"position": null,

"position_name": null,

"hire_date": "2019-04-02",

"gender": null,

"birthday": null,

"verify_mode": -1,

"emp_type": null,

"contact_tel": null,

"office_tel": null,
"mobile": null,

"national": null,

"city": null,

"address": null,

"postcode": null,

"email": null,

"enroll_sn": null,

"ssn": null,

"religion": null,

"enable_att": true,

"enable_overtime": false,

"enable_holiday": true,

"dev_privilege": 0,

"self_password":
"pbkdf2_sha256$36000$XBVRNMOywdNI$P4W7MIZVa3Ho2VBdU2SewS/pb8
GavBYSGBXM/bgL+N0=",

"flow_role": [],

"area": [

"id": 1,

"area_code": "1",

"area_name": "Not Authorized"

],

"area_name": "Not Authorized",

"app_status": 0,

"app_role": 1

6.4 Update Employee API

HTTP Method PATCH


URI /personnel/api/employees/ <id>/

Data Type application/json

Response Type JSON

Reference:
Request Parameter
[Link]

Request Address:

[Link]

Resquest Body:

"first_name": "emp3_first_name_update",

"last_name": "emp3_last_name_update",

Response Data:

"id": 6,

"emp_code": "employee333",

"first_name": "emp3_first_name_update",

Response JSON Format "last_name": "emp3_last_name_update",

"nickname": null,

"device_password": null,

"card_no": null,

"department": 1,

"position": null,

"hire_date": "2019-04-02",

"gender": null,

"birthday": null,

"verify_mode": -1,

"emp_type": null,

"contact_tel": null,

"office_tel": null,
"mobile": null,

"national": null,

"city": null,

"address": null,

"postcode": null,

"email": null,

"enroll_sn": null,

"ssn": null,

"religion": null,

"enable_att": true,

"enable_overtime": false,

"enable_holiday": true,

"dev_privilege": 1,

"self_password":
"pbkdf2_sha256$36000$XBVRNMOywdNI$P4W7MIZVa3Ho2VBdU2SewS/pb8
GavBYSGBXM/bgL+N0=",

"flow_role": [],

"area": [

],

"app_status": 0,

"app_role": 1

6.5 Delete Employee API

HTTP Method DELETE

URI /personnel/api/employees/<id>/

Data Type application/json


Response Type JSON

Request Address [Link]

7. Department API

7.1 Get Department List API

HTTP Method GET

URI /personnel/api/departments/

Data Type application/json

Response Type JSON

[Link]
Request Address =**&dept_code=**&dept_name=**&parent_dept=**
page, limit, dept_code, dept_name, parent_dept are optional filter fields.
Request address:
[Link]

Response JSON format:


{
"count": 1,
"next": null,
"previous": null,
"msg": "",
"code": 0,
Response JSON Format
"data": [
{
"id": 1,
"dept_code": "1",
"dept_name": "Department",
"parent_dept": null,
"parent_dept_name": null
}
]
}
7.2 Get Department Object Info API

HTTP Method GET

URI /personnel/api/departments/<id>/

Data Type application/json

Response Type JSON

Request Address:
[Link]

Request Body:
{
Response JSON Format "id": 1,
"dept_code": "1",
"dept_name": "Department",
"parent_dept": null,
"parent_dept_name": null
}

7.3 Create Department API

HTTP Method POST

URI /personnel/api/departments/

Data Type application/json

Response Type JSON

Reference:
Request Parameter
[Link]

Request Address
[Link]

Request Body
Response JSON Format
{
"dept_code": "222",
"dept_name": "Department222",
"parent_dept": 1
}

Response Data
{
"id": 2,
"dept_code": "222",
"dept_name": "Department222",
"parent_dept": 1
}
7.4 Update Department API

HTTP Method PATCH

URI /personnel/api/departments/ <id>/

Data Type application/json

Response Type JSON

Reference:
Request Parameter
[Link]

Request Address
[Link]

Resquest Body
{
"dept_name": "Department222_update"
}

Response JSON Format


Response Data
{
"id": 2,
"dept_code": "222",
"dept_name": "Department222_update",
"parent_dept": 1
}
}

7.5 Delete Department API

HTTP Method DELETE


URI /personnel/api/departments/<id>/

Data Type application/json

Response Type JSON

Request Address:

[Link]
Response JSON Format
Resquest Body:

{}

8. Area API

8.1 Get Area List API

HTTP Method GET

URI /personnel/api/areas/

Data Type application/json

Response Type JSON

[Link]
Request Address a_code=**&area_name=**&parent_area=**
page, limit, area_code, area_name, parent_area are optional filter fields.
Request address:
[Link]

Response JSON format:


{
"id": 2,
Response JSON Format "area_code": "2",
"area_name": "Primero",
"parent_area": {
"id": 1,
"area_code": "1",
"area_name": "Not Authorized",
"parent_area": null
},
"parent_area_name": "Not Authorized"
}
8.2 Get Area Object Info API

HTTP Method GET

URI /personnel/api/areas/<id>/

Data Type application/json

Response Type JSON

Request address:
[Link]

Response JSON format:


{
"id": 2,
"area_code": "2",
"area_name": "Primero",
Response JSON Format
"parent_area": {
"id": 1,
"area_code": "1",
"area_name": "Not Authorized",
"parent_area": null
},
"parent_area_name": "Not Authorized"
}

8.3 Create Area API

HTTP Method POST

URI /personnel/api/areas/

Data Type application/json

Response Type JSON

Request Parameter Reference: [Link]


Request Address
[Link]

Request Body
{
"area_code": "222",
"area_name": "Department222",
"parent_area": 1
Response JSON Format }

Response Data
{
"id": 2,
"area_code": "222",
"area_name": "Department222",
"parent_area": 1
}
8.4 Update Area API

HTTP Method PATCH

URI /personnel/api/areas/ <id>/

Data Type application/json

Response Type JSON

Request Parameter Reference: [Link]


Request Address
[Link]

Resquest Body
{
"area_name": "Area222_update"
}

Response JSON Format


Response Data
{
"id": 2,
"area_code": "222",
"area_name": "area222_update",
"parent_area": 1
}
}

8.5 Delete Area API

HTTP Method DELETE

URI /personnel/api/areas/<id>/

Data Type application/json

Response Type JSON

Request Address:

[Link]
Response JSON Format
Resquest Body:

{}

9. Position API

9.1 Get Position List API

HTTP Method GET


URI /personnel/api/positions/

Data Type application/json

Response Type JSON

[Link]
**&position_code=**&position_name=**&parent_position=**
Request Address
page, limit, position_code, position_name, parent_position are optional filter
fields.
Request address:
[Link]

Response JSON format:


{
"count": 1,
"next": null,
"previous": null,
"msg": "",
"code": 0,
Response JSON Format
"data": [
{
"id": 1,
"position_code": "1",
"position_name": "Department",
"parent_position": null,
"parent_position_name": null
}
]
}
9.2 Get Position Object Info API

HTTP Method GET

URI /personnel/api/positions/<id>/

Data Type application/json

Response Type JSON

Request Address:
Response JSON Format [Link]
Request Body:
{
"id": 1,
"position_code": "1",
"position_name": "Position",
"parent_position": null,
"parent_position_name": null
}

9.3 Create Position API

HTTP Method POST

URI /personnel/api/positions/

Data Type application/json

Response Type JSON

Request Parameter Reference: [Link]

Request Address
[Link]

Request Body
{
"position_code": "222",
"position_name": "Position222",
"parent_position": 1
Response JSON Format }

Response Data
{
"id": 2,
"position_code": "222",
"position_name": "Position222",
"parent_position": 1
}
9.4 Update Position API

HTTP Method PATCH


URI /personnel/api/positions/ <id>/

Data Type application/json

Response Type JSON

Request Parameter Reference: [Link]

Request Address
[Link]

Resquest Body
{
"position_name": "Position222_update"
}

Response JSON Format


Response Data
{
"id": 2,
"position_code": "222",
"position_name": "Position222_update",
"parent_position": 1
}
}

9.5 Delete Position API

HTTP Method DELETE

URI /personnel/api/positions/<id>/

Data Type application/json

Response Type JSON

Request Address:

[Link]
Response JSON Format
Resquest Body:

{}
10. Transaction API
10.1 Get Transaction List API

HTTP Method GET

/iclock/api/transctions/
URI

Data Type application/json

Response Type JSON

[Link]
=**&end_time=**
Request Address
page , limit, emp_code, terminal_sn, start_time, end_time are optional filter
fields.

Request Address:
[Link]
_time=2019-03-01 [Link]&end_time=2019-04-1 [Link]

Response JSON format:


{
"count": 7,
"next": null,
"previous": null,
"msg": "",
"code": 0,
"data": [
Response JSON Format
{
"id": 1,
"emp_code": "100001",
"punch_time": "2019-03-04 [Link]",
"punch_state": "0",
"verify_type": 1,
"work_code": null,
"terminal_sn": "",
"terminal_alias": null,
"area_alias": null,
"longitude": null,
"latitude": null,
"gps_location": "",
"mobile": null,
"source": 0,
"purpose": 1,
"crc": null,
"is_attendance": 1,
"reserved": null,
"upload_time": "2019-03-04 [Link]",
"sync_status": 1,
"sync_time": null,
"emp": null,
"terminal": null
},
...
...
...
]
}

You might also like