logo

Retrieval

This interface is used to retrieve all operational logs under a company

Request Method

GET work_logs

Request Parameters

AttributeTypeDescriptionRequired
begin_dateStringStart dateYes
end_dateStringEnd dateYes
pageIntegerPage numberNo, default is 1
per_pageIntegerNumber of items per page, maximum 50No, default is 20
  • Note: The date format is 'YYYY-MM-DD'
  • Note: This interface can only retrieve operational logs within 90 days

Response Data

AttributeTypeDescription
codeIntegerExecution result code, 1000 represents success
metaJSON ObjectPagination information
logsArrayLog content, structure as follows
  • meta data structure
AttributeTypeDescription
current_pageIntegerCurrent page number
total_pagesIntegerTotal number of pages
  • log data structure
AttributeTypeDescription
idIntegerID of the business record template
user_idStringOperator ID
user_nick_nameStringOperator name
obj_idIntegerObject ID of the operation
obj_nick_nameStringName of the operation object
device_uaStringTerminal
ipStringIP address
op_moduleStringOperation module
op_typeStringOperation type
op_descStringOperation content
created_atStringTime of the operation
  • op_module explanation
ValueExplanation
sysSystem
imInstant Messaging
ccCall Center
ticketTicket
  • op_type explanation
ValueExplanation
sys_loginWeb login status
sys_statusWeb online status
im_stautsChat online status
cc_work_wayCall device status
cc_work_stateCall online status
ticket_allotTicket reception and distribution switch

Example

Request

curl -X GET 'http://demo.udesk.cn/open_api_v1/work_logs?email=admin@udesk.cn&timestamp=1639119642&sign=5f17da1c4a2103185643ab5bb949545e406a65de9abaa3e529204ef3f9f54a1e&sign_version=v2&nonce=k99qp2j7tbbxvwfuhzo9sk&begin_date=2021-12-09&end_date=2021-12-10' \

Response

{
    "code": 1000,
    "logs":
    [
        {
            "id": 32905,
            "user_id": 741,
            "user_nick_name": "wlyb3test",
            "obj_id": 741,
            "obj_nick_name": "wlyb3test",
            "device_ua": "Browser-Windows 10 Chrome 92.0.4515",
            "ip": "100.121.196.62",
            "op_module": "sys",
            "op_type": "sys_login",
            "op_desc": "Non-login ---> Login",
            "created_at": "2021-12-09T14:06:49.000+08:00"
        }
    ]
}

Error Code Explanation

Error CodeError Message
2059Incorrect open API signature
2000Incorrect start date
2000Incorrect end date
2000End date cannot be less than start date