Create Audit Log


Create a record of audit logs.

Request Format


POST https://{apigw-address}/app-portal-service/api/v3/event/log/produce

Request Parameters (URI)


Name

Location (Path/Query)

Required/Optional

Data Type

Description

orgId

Query

Required

String

OU ID. How to get orgId >>

Request Parameters (Header)


Name

Required/Optional

Data Type

Description

Authorization

Optional

String

The access token generated after the user logs in and selects the OU, represented by Bearer Token, is in the form of Bearer {your token}. You can call the Log In or Refresh Access Token API to obtain the access token.

  • If this parameter is not specified, the user of the event will be considered as the application.

  • If this parameter is specified, the user of the event will be considered as the user which the access token belongs to. The OU for obtaining the Access Token should be consistent with the value of the request parameter orgId.

Request Parameters (Body)


Name

Required/Optional

Data Type

Description

subjectId

Required

String

The ID of the audit log subject, maximum length 64 characters, such as menu ID.

subjectType

Required

String

The type of the audit log subject, maximum length 64 characters.

upstreamId

Optional

String

The ID of the upstream subject for the audit log subject, maximum length 64 characters. For example, the upstream subject of a menu is an application.

upstreamType

Optional

String

The type of the upstream subject for the audit log subject, maximum length 64 characters.

Response Parameters


Name

Data Type

Description

data

Boolean

The parameter always responses true.

Error Codes


Error Code

Description

31400

  • The required parameters are missing.

  • The OU information in your token does not match the OU information in the orgId parameter.

  • The OU does not acquire this application.

31401

The token is not valid.

31404

The OU does not exist.

Samples

Request Sample


url: /app-portal-service/api/v3/event/log/produce?orgId=yourOrgId
method: POST

requestBody:
{
    "subjectId": "your_subject_id",
    "subjectType": "your_subject_type",
    "upstreamId": "your_upstream_id",
    "upstreamType": "your_upstream_type"
}

Return Sample


{
  "code": 0,
  "data": true,
  "message": "OK"
}