Save Operation Log

Last Updated on : 2021-08-14 08:25:19download

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 name Type IN Required Description
req AuditLogSaveReq false Add a log.

Description of req

Parameter name Type IN Required Description
username String false The username.
user_id String false The user ID.
role String false The role.
account String false The account.
operate_type String false The operation type.
operate_content String false The operation content.
operate_geo_info String false The geographic information about the user during login.
operate_ip_info String false The IP address.
merchant_code String false The merchant code, which can be customized. The merchants’ log logic can be isolated based on the merchant code.
ext String false The extension field.

Return parameter

Parameter name Type Description
result Boolean The 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.