Save Operation Log

Last Updated on : 2024-12-25 08:21:08download

Save the information about a specified operation log, such as the username, user ID, user account, and user operation content.

API address

POST: /v1.0/iot-03/audit/operate-logs

Request parameter

Parameter nameTypeINRequiredDescription
reqAuditLogSaveReq falseAdd a log.

Description of req

Parameter nameTypeINRequiredDescription
usernameString falseThe username.
user_idString falseThe user ID.
roleString falseThe role.
accountString falseThe account.
operate_typeString falseThe operation type.
operate_contentString falseThe operation content.
operate_geo_infoString falseThe geographic information about the user during login.
operate_ip_infoString falseThe IP address.
merchant_codeString falseThe merchant code, which can be customized. The merchants' log logic can be isolated based on the merchant code.
extString falseThe extension field.

Return parameter

Parameter nameTypeDescription
resultBooleanThe operation result.

Request example

POST: /v1.0/iot-03/audit/operate-logs
{
  "username": "***123",
  "user_id": "user123",
  "role": "admin",
  "account": "1803614****",
  "operate_type": "Logout",
  "operate_content": "Log out of the system",
  "operate_geo_info": "Shenzhen City, Guangdong Province",
  "operate_ip_info": "192.168.1.9",
  "merchant_code": "tuya",
  "ext": "kuozhan"
}

Return example

{
    "result": true,
    "t": 1628826050135,
    "success": true
}

Error code

For more information, see error code.