Work Activities

Tài liệu này mô tả các phần liên quan đến Quản lý công việc. Bao gồm:

Timekeeping activity

Check-In

POST /api/v1/works/timekeeping/checkin
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng.
  • client_id -- ID client.
  • location -- [lat,long] Kinh độ, vĩ độ thực hiện chấm công vào.
  • photo -- [Base64]-Ảnh tại điểm chấm công (có gắn ngày giờ).
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "location": [10.785092,106.6913373],
    "photo": "iVBORw0KGgoAAAANSUhEU..."
}
Response JSON Object:
 
  • error_code (integer) -- Error Code.
  • error_message (string) -- Error Message.
  • written_time (long) -- Thời gian Server ghi nhận (Unix timestamp).
{
    "error_code": 0,
    "error_message": "",
    "written_time": 1513651191000
}

Check-Out

POST /api/v1/works/timekeeping/checkout
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng.
  • client_id -- ID client.
  • location -- [lat,long] Kinh độ, vĩ độ thực hiện chấm công ra.
  • photo -- [Base64]-Ảnh tại điểm chấm công (có gắn ngày giờ).
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "location": [10.785092,106.6913373],
    "photo": "iVBORw0KGgoAAAANSUhEU..."
}
Response JSON Object:
 
  • error_code (integer) -- Error Code.
  • error_message (string) -- Error Message.
  • written_time (long) -- Thời gian Server ghi nhận (Unix timestamp).
{
    "error_code": 0,
    "error_message": "",
    "written_time": 1513651191000
}

History

POST /api/v1/works/timekeeping/history
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng.
  • client_id -- ID client.
  • from_date -- Lấy dữ liệu từ ngày.
  • to_date -- Lấy dữ liệu đến ngày.
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "from_date": "2017-11-01",
    "to_date": "2017-11-30"
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": "",
    "data": [{
       "1513651191000": {
                  "in": {
                          "writen_time": 1513651191000,
                          "location": [10.785092, 106.6913373]
                  },
                  "out": {
                          "writen_time": 1513651191001,
                          "location": [10.785092, 106.6913373]
                  }
           }
    }]
}

Absent activity

Apply for absence

POST /api/v1/works/absent/apply
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng.
  • client_id -- ID client.
  • start_time -- Thời gian bắt đầu.
  • end_time -- Thời gian kết thúc.
  • kind -- Loại phép (Xem Kind definition).
  • reason -- Lý do nghỉ.
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "start_time": "2017-08-14 08:00",
    "end_time": "2017-08-15 08:00",
    "kind": 0,
    "reason": "Bệnh rất nặng :(("
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": ""
}

Update Application of Absence

POST /api/v1/works/absent/update-application
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng.
  • client_id -- ID client.
  • absence_id -- ID của đơn xin phép.
  • start_time -- Thời gian bắt đầu.
  • end_time -- Thời gian kết thúc.
  • kind -- Loại phép (Xem Kind definition).
  • reason -- Lý do nghỉ.
  • hidden -- Ẩn đi (0 hiện, 1 ẩn).
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "absence_id": "19863",
    "start_time": "2017-08-14 08:00",
    "end_time": "2017-08-15 08:00",
    "kind": 0,
    "reason": "Bệnh rất nặng :((",
    "hidden": 0
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": ""
}

Absence approval

POST /api/v1/works/absent/confirm
Parameters:
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "absence_id": "19863",
    "approval": 0,
    "message": "Nghỉ luôn thì được ^_^"
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": ""
}

Absence table

POST /api/v1/works/absent/table
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng.
  • client_id -- ID client.
  • from_date -- Lấy dữ liệu từ ngày.
  • to_date -- Lấy dữ liệu đến ngày.
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "from_date": "2017-11-01",
    "to_date": "2017-11-30"
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": "",
    "data": [{
       "absence_id": "19863",
       "user_id": "18963",
       "fullname": "Leon Tran",
       "position": "DEV",
       "deparment": "VAS",
       "branch": "HCM",
       "phone": "0961095661",
       "email": "leon.tran@mobistar.vn",
       "absent_time": [1513651191000, 1513651191000],
       "total_time": 1,
       "kind": 0,
       "reason": "Bệnh",
       "status": 0
    }]
}

Absence employee table

POST /api/v1/works/absent/employee-table
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người quản lý.
  • client_id -- ID client.
  • from_date -- Lấy dữ liệu từ ngày.
  • to_date -- Lấy dữ liệu đến ngày.
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "from_date": "2017-11-01",
    "to_date": "2017-11-30"
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": "",
    "data": [{
       "absence_id": "19863",
       "user_id": "18963",
       "fullname": "Leon Tran",
       "position": "DEV",
       "deparment": "VAS",
       "branch": "HCM",
       "phone": "0961095661",
       "email": "leon.tran@mobistar.vn",
       "absent_time": [1513651191000, 1513651191000],
       "total_time": 1,
       "kind": 0,
       "reason": "Bệnh",
       "status": 0
    }]
}

Absence detail

POST /api/v1/works/absent/detail
Parameters:
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "absence_id": "18963"
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": "",
    "data":
    {
       "absence_id": "19863",
       "user_id": "18963",
       "fullname": "Leon Tran",
       "position": "DEV",
       "deparment": "VAS",
       "branch": "HCM",
       "phone": "0961095661",
       "email": "leon.tran@mobistar.vn",
       "absent_time": [1513651191000, 1513651191000],
       "total_time": 1,
       "kind": 0,
       "reason": "Bệnh",
       "status": 0
    }
}

Absence management

POST /api/v1/works/absent/management
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng (quản lý hoặc nhân viên).
  • client_id -- ID client.
  • from_date -- Lấy dữ liệu từ ngày.
  • to_date -- Lấy dữ liệu đến ngày.
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "from_date": "2017-11-01",
    "to_date": "2017-11-30"
}
Response JSON Object:
 
  • error_code (integer) -- Error Code.
  • error_message (string) -- Error Message.
  • remain (integer) -- Số ngày phép còn lại.
  • total (integer) -- Tất cả đơn đã nhận/ gửi.
  • waiting_for_approval (integer) -- Số đơn chờ duyệt.
  • total_approval (integer) -- Số đơn đã/ đã được duyệt.
  • total_unapproved (integer) -- Số đơn không/ không được duyệt.
  • total_update (integer) -- Số đơn yêu cầu/ được yêu cầu chỉnh sửa.
{
    "error_code": 0,
    "error_message": "",
    "remain": 10,
    "total": 10,
    "waiting_for_approval": 10,
    "total_approval": 10,
    "total_unapproved": 10,
    "total_update": 10
}

Overtime activity

Apply for OT

POST /api/v1/works/overtime/apply
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng.
  • client_id -- ID client.
  • start_time -- Thời gian bắt đầu.
  • end_time -- Thời gian kết thúc.
  • reason -- Lý do tăng ca.
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "start_time": "2017-08-14 08:00",
    "end_time": "2017-08-15 08:00",
    "reason": "ItViec - Ít mà chất nên làm chậm deadline ;(("
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": ""
}

Update Application of OT

POST /api/v1/works/overtime/update-application
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng.
  • client_id -- ID client.
  • overtime_id -- ID của đơn yêu cầu tăng ca.
  • start_time -- Thời gian bắt đầu.
  • end_time -- Thời gian kết thúc.
  • reason -- Lý do tăng ca.
  • hidden -- Ẩn đi (0 hiện, 1 ẩn).
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "overtime_id": "19863",
    "start_time": "2017-08-14 08:00",
    "end_time": "2017-08-15 08:00",
    "reason": "ItViec - Ít mà chất nên làm chậm deadline ;((",
    "hidden": 0
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": ""
}

Overtime approval

POST /api/v1/works/overtime/confirm
Parameters:
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "overtime_id": "19863",
    "approval": 0,
    "message": "Người ta làm 5' còn em là 1 tuần là như nào?"
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": ""
}

Overtime table

POST /api/v1/works/overtime/table
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng (quản lý hoặc nhân viên).
  • client_id -- ID client.
  • from_date -- Lấy dữ liệu từ ngày.
  • to_date -- Lấy dữ liệu đến ngày.
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "from_date": "2017-11-01",
    "to_date": "2017-11-30"
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": "",
    "data": [{
       "overtime_id": "19863",
       "user_id": "18963",
       "fullname": "Leon Tran",
       "position": "DEV",
       "deparment": "VAS",
       "branch": "HCM",
       "phone": "0961095661",
       "email": "leon.tran@mobistar.vn",
       "overtime_time": [1513651191000, 1513651191000],
       "total_time": 1,
       "reason": "Urgent",
       "status": 0
    }]
}

Overtime employee table

POST /api/v1/works/overtime/employee-table
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người quản lý.
  • client_id -- ID client.
  • from_date -- Lấy dữ liệu từ ngày.
  • to_date -- Lấy dữ liệu đến ngày.
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "from_date": "2017-11-01",
    "to_date": "2017-11-30"
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": "",
    "data": [{
       "overtime_id": "19863",
       "user_id": "18963",
       "fullname": "Leon Tran",
       "position": "DEV",
       "deparment": "VAS",
       "branch": "HCM",
       "phone": "0961095661",
       "email": "leon.tran@mobistar.vn",
       "overtime_time": [1513651191000, 1513651191000],
       "total_time": 1,
       "reason": "Urgent",
       "status": 0
    }]
}

Overtime detail

POST /api/v1/works/overtime/detail
Parameters:
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "overtime_id": "18963",
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": "",
    "data":
    {
       "overtime_id": "19863",
       "user_id": "18963",
       "fullname": "Leon Tran",
       "position": "DEV",
       "deparment": "VAS",
       "branch": "HCM",
       "phone": "0961095661",
       "email": "leon.tran@mobistar.vn",
       "absent_time": [1513651191000, 1513651191000],
       "total_time": 1,
       "reason": "Urgent",
       "status": 0
    }
}

Overtime management

POST /api/v1/works/overtime/management
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng (quản lý hoặc nhân viên).
  • client_id -- ID client.
  • from_date -- Lấy dữ liệu từ ngày.
  • to_date -- Lấy dữ liệu đến ngày.
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "from_date": "2017-11-01",
    "to_date": "2017-11-30"
}
Response JSON Object:
 
  • error_code (integer) -- Error Code.
  • error_message (string) -- Error Message.
  • total (integer) -- Tất cả đơn đã nhận/ gửi.
  • waiting_for_approval (integer) -- Số đơn chờ duyệt.
  • total_approval (integer) -- Số đơn đã/ đã được duyệt.
  • total_unapproved (integer) -- Số đơn không/ không được duyệt.
  • total_update (integer) -- Số đơn yêu cầu/ được yêu cầu chỉnh sửa.
{
    "error_code": 0,
    "error_message": "",
    "total": 10,
    "waiting_for_approval": 10,
    "total_approval": 10,
    "total_unapproved": 10,
    "total_update": 10
}