# Obtain User Operation Log - GetUserOperationEvents

## Overview

Obtain User Operation Log

 > 💡 Currently, only the logs from the past 365 days can be queried through this API.




## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `GetUserOperationEvents`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.scloudsg.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **ProjectId** | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the [GetProjectList interface](/docs/api/summary/get_project_list). |No|
| **BeginTime** | int | Start Time (UNIX Timestamp) |No|
| **EndTime** | int | End Time (UNIX Timestamp) |No|
| **MaxResults** | int | Maximum number of records per query, the maximum value is 50 |No|
| **NextToken** | string | Used to request the next page of query results. The request parameters must be consistent with the previous request. |No|
| **ResourceID** | string | Resource ID, used to search for operation logs associated with a certain resource |No|
| **AccessKeyIDs.N** | string | Api Key, the maximum value is 50 |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **NextToken** | string | Used to request the next page of query results. The request parameters must be consistent with the previous request. |No|
| **Events** | array[[*UserOperationEvent*](#useroperationevent)] | Operation Event List |No|

#### Data Model


#### UserOperationEvent

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region |No|
| **Api** | string | Operated API |No|
| **IsSuccess** | boolean | Is it successful? |No|
| **OperateTime** | int | Operation Time |No|
| **UserName** | string | Username |No|
| **UserEmail** | string | User Email |No|
| **RelatedResource** | array[[*RelatedResource*](#relatedresource)] | Resource associated with the operation event |No|
| **RemoteIP** | string | Request source IP |No|
| **AccessKeyID** | string | Api Key |No|

#### RelatedResource

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **ResourceId** | string | Resource ID |No|
| **ResourceName** | string | Resource Name |No|

## Example

### Request Example
    
```
https://api.scloudsg.com/?Action=GetUserOperationEvents
&ProjectId=DybfOwNo
&BeginTime=2
&EndTime=4
&MaxResults=7
&NextToken=nLgQPnKo
&ResourceID=CfrwODDl
&AccessKeyIDs=XkYCKzZG
```

### Response Example
    
```json
{
  "Action": "GetUserOperationEventsResponse",
  "Events": [
    {
      "Api": "kNELMpfb",
      "IsSuccess": true,
      "OperateTime": 2,
      "Region": "sLtsxECu",
      "RelatedResource": [
        {
          "ResourceId": "HcWkaBoa",
          "ResourceName": "yVfCJcnu"
        }
      ],
      "UserEmail": "oZHZSIVq",
      "UserName": "MMmTomWP"
    }
  ],
  "NextToken": "SpWAGVWQ",
  "RetCode": 0
}
```





