Employee Profile

Tài liệu này mô tả cách sử dụng thông tin người dùng từ WebService. Bao gồm các phần sau:

Get profile

POST /api/v1/profile/get
Parameters:
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963"
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": "",
    "data":
    {
       "access_code": "_HASH_",
       "user_id": "18963",
       "fullname": "Leon Tran",
       "position": "DEV",
       "deparment": "VAS",
       "branch": "HCM",
       "position_name": "Nhóm phát triển",
       "deparment_name": "Phòng Dịch vụ gia tăng",
       "branch_name": "Chi nhánh Hồ Chí Minh",
       "dob": 1513651191000,
       "phone": "0961095661",
       "email": "leon.tran@mobistar.vn",
       "address": "Saigon Vietnam",
       "avatar": "https://cdn.mobistar.vn/18963.png"
    }
}

Update profile

POST /api/v1/profile/set
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng.
  • client_id -- ID client.
  • phone -- Điện thoại.
  • address -- Địa chỉ.
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "phone": "0961095661",
    "address": "Saigon Vietnam"
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": ""
}

Change password

POST /api/v1/profile/change-password
Parameters:
  • access_token -- Xem Get Access Token Key.
  • checksum -- Check Sum.
  • user_id -- ID người dùng.
  • client_id -- ID client.
  • current -- Mật khẩu hiện tại (Đã mã hóa với Secret Key).
  • new -- Mật khẩu mới (Đã mã hóa với Secret Key).
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963",
    "current": "_HASH_",
    "new": "_HASH_"
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": ""
}

Reset password

POST /api/v1/profile/reset-password
Parameters:
  • imei -- IMEI của thiết bị (Đã mã hóa với Secret Key).
  • mac -- Địa chỉ MAC của thiết bị (Đã mã hóa với Secret Key).
  • username -- Tên người dùng (Đã mã hóa với Secret Key).
  • checksum -- Check Sum.
{
    "imei": "356938035643809",
    "mac": "00:0a:95:9d:68:16",
    "username": "leon.tran@mobistar.vn",
    "checksum": "_HASH_"
}
Response JSON Object:
 
{
    "error_code": 0,
    "error_message": ""
}

Ghi chú

Generate ra một mật khẩu mới và gửi mật khẩu này vào email của user_id trên.

Get permission

POST /api/v1/profile/permission
Parameters:
{
    "access_token": "_HASH_",
    "checksum": "_HASH_",
    "user_id": "18963",
    "client_id": "18963"
}
Response JSON Object:
 
  • error_code (integer) -- Error Code.
  • error_message (string) -- Error Message.
  • data (object) -- Các tính năng được phép.
{
    "error_code": 0,
    "error_message": "",
    "data":
    [
       {"code":"CODE1", "name":"NAME1", "insert":1, "update":1, "delete":1},
       {"code":"CODE2", "name":"NAME2", "insert":1, "update":1, "delete":1},
       {"code":"CODE3", "name":"NAME3", "insert":1, "update":1, "delete":1}
    ]
}

Get shift

POST /api/v1/profile/shift
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 (integer) -- Error Code.
  • error_message (string) -- Error Message.
  • data (object) -- Những ca làm việc của nhân viên này.
{
    "error_code": 0,
    "error_message": "",
    "data":
    {
       "day":
       {
          "name":"Hanh Chinh",
          "time_in":"8:00",
          "start_rest":"12:00",
          "end_rest":"13:30",
          "time_out":"17:30"
       }
    }
}