GetRequestLog

Updated at:

Retrieves an API call log for troubleshooting. Specify the request ID from the original API response.

Operation description

Supports querying API call logs across RAM users or Alibaba Cloud accounts through RAM authorization or role assumption. For more information about authorization methods, see Cross-account authorization for API error diagnosis.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

openapiexplorer:GetRequestLog

get

*All Resource

*

None None

Request syntax

GET /getRequestLog HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

logRequestId

string

Yes

The request ID of the original API call. Use an uppercase UUID.

123E4567-E89B-12D3-A456-426614174000

Response elements

Element

Type

Description

Example

object

Schema of Response

logInfo

object

The details of the API request log.

basicInfo

object

The basic information of the API request.

api

string

The name of the API for the queried request.

RunInstances

apiDoc

object

The API documentation information.

aliyunSite

string

The documentation link for the China site.

https://api.aliyun.com/document/Ecs/2014-05-26/RunInstances

alibabacloudSite

string

The documentation link for the international site.

https://api.alibabacloud.com/document/Ecs/2014-05-26/RunInstances

apiVersion

string

The API version information.

2014-05-26

product

string

The product code.

Ecs

productName

object

The product name information, including the Chinese and English names.

cnName

string

The Chinese name of the product.

云服务器 ECS

enName

string

The English name of the product.

Elastic Compute Service

apiStyle

string

The API style, which can be ROA or RPC.

roa

logRequestId

string

The request ID of the original API call.

123E4567-E89B-12D3-A456-426614174000

httpStatusCode

string

The HTTP status code in the queried log.

404

errorCode

string

The error code in the queried log. This field is empty if the queried request did not return an error.

IncorrectStatus.TransitRouter

errorMessage

string

The error message in the queried log. This field is empty if the queried request did not return an error.

The resource is not in a valid state for the operation.

accessDeniedDetail

object

Details of an access denied error. This field is returned only if the original request failed a permission check.

policyType

string

The policy type that caused the access denial.

AccountLevelIdentityBasedPolicy

authPrincipalOwnerId

string

The UID of the Alibaba Cloud account to which the current identity belongs.

1001234561234567

authPrincipalType

string

The identity type of the operator.

SubUser

authPrincipalDisplayName

string

The identifier displayed for the principal.

205618123456123456

noPermissionType

string

The reason for the access denial.

ImplicitDeny

authAction

string

The specific action that caused the access denial.

openapiexplorer:GetRequestLog

encodedDiagnosticMessage

string

The encoded message for diagnostics. You can call the DecodeDiagnosticMessage API operation of RAM to obtain more diagnostic information.

-

httpMethod

string

The HTTP method, such as GET, PUT, or POST.

GET

requestDuration

string

The time taken by the gateway from receiving the request to returning the response. Unit: milliseconds.

188

sdkRequestTime

string

The time when the request is initiated. The time is displayed in UTC and follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.

2025-01-21T07:43:06Z

gatewayProcessTime

string

The UTC time when the gateway received the request, in ISO 8601 format (yyyy-MM-ddTHH:mm:ssZ).

2025-01-21T07:43:06Z

regionId

string

The region ID of the service.

cn-hangzhou

endpoint

string

The endpoint of the service in the region.

ecs.cn-hangzhou.aliyuncs.com

throttlingResult

string

The throttling check result. Valid values:

  • FC.PASS: The request is not blocked by the throttling check (no rate limiting is triggered).

  • FC.DENY: The request is blocked by the throttling check (rate limiting is triggered).

Valid values:

  • FC.PASS :

    Not blocked by the throttling check.

  • FC.DENY :

    Blocked by the throttling check.

FC.PASS

callerInfo

object

The caller information.

callerType

string

The caller type. Valid values:

  • customer: Alibaba Cloud account.

  • sub: RAM user.

  • AssumedRoleUser: A caller using temporary STS credentials for an assumed RAM role.

Valid values:

  • sub :

    RAM user.

  • AssumedRoleUser :

    A caller using temporary STS credentials for an assumed RAM role.

  • customer :

    Alibaba Cloud account.

sub

callerIp

string

The IP address of the caller.

100.68.xxx.xxx

masterAccountId

string

The ID of the primary account.

1973374733454118

callerAccountId

string

The account ID of the caller.

241009849925897811

userAgent

string

The user agent information.

AlibabaCloud API Workbench

vpcId

string

The source VPC ID.

vpc-abcd

authenticationInfo

object

The authentication information.

signatureVersion

string

The signature version.

unknown

signatureMethod

string

The signature method. Valid values:

  • HMAC-SHA1: Uses the HMAC-SHA1 algorithm for signing.

  • HMAC-SHA256: Uses the HMAC-SHA256 algorithm for signing.

HMAC-SHA256

authenticationType

string

The authentication type. Valid values:

  • AK: Includes permanent AccessKeys, temporary AccessKeys, and STS tokens.

  • PRIVATEKEY: An AccessKey that uses asymmetric cryptography.

  • BEARERTOKEN: An authentication mechanism widely used in the OAuth 2.0 framework and cloud services.

  • CUSTOM_SPI: An efficient and secure authentication method applicable to the delivery and management of SaaS products in Alibaba Cloud Marketplace.

  • Anonymous: Anonymous access.

  • DPS: Similar to AccessKey, but uses a signature algorithm different from the official Alibaba Cloud algorithm, and is exclusive to specific products.

AK

ak

string

The AccessKey ID used to make the original API call.

LTAI1234abcd

parameters

array<object>

The request parameter information.

object

name

string

The request parameter name.

InstanceType

value

any

The request parameter value.

ecs.g6.large

required

boolean

Specifies whether the request parameter is required.

false

type

string

The request parameter type.

string

responses

object

The response information for the request.

responseBody

string

The response body of the original API call.

{"RequestId":"123E4567-E89B-12D3-A456-426614174000","Code":"IncorrectStatus.TransitRouter","Message":"The resource is not in a valid state for the operation."}

responseBodyFormat

string

The response body type. Valid values: JSON, XML, and HTML.

JSON

requestId

string

The ID of this log lookup request.

9BFC4AC1-6BE4-5405-BDEC-CA288D404812

Examples

Success response

JSON format

{
  "logInfo": {
    "basicInfo": {
      "api": "RunInstances",
      "apiDoc": {
        "aliyunSite": "https://api.aliyun.com/document/Ecs/2014-05-26/RunInstances",
        "alibabacloudSite": "https://api.alibabacloud.com/document/Ecs/2014-05-26/RunInstances"
      },
      "apiVersion": "2014-05-26",
      "product": "Ecs",
      "productName": {
        "cnName": "云服务器 ECS",
        "enName": "Elastic Compute Service"
      },
      "apiStyle": "roa",
      "logRequestId": "123E4567-E89B-12D3-A456-426614174000",
      "httpStatusCode": "404",
      "errorCode": "IncorrectStatus.TransitRouter",
      "errorMessage": "The resource is not in a valid state for the operation.",
      "accessDeniedDetail": {
        "policyType": "AccountLevelIdentityBasedPolicy",
        "authPrincipalOwnerId": "1001234561234567",
        "authPrincipalType": "SubUser",
        "authPrincipalDisplayName": "205618123456123456",
        "noPermissionType": "ImplicitDeny",
        "authAction": "openapiexplorer:GetRequestLog",
        "encodedDiagnosticMessage": "-"
      },
      "httpMethod": "GET",
      "requestDuration": "188",
      "sdkRequestTime": "2025-01-21T07:43:06Z",
      "gatewayProcessTime": "2025-01-21T07:43:06Z",
      "regionId": "cn-hangzhou",
      "endpoint": "ecs.cn-hangzhou.aliyuncs.com",
      "throttlingResult": "FC.PASS"
    },
    "callerInfo": {
      "callerType": "sub",
      "callerIp": "100.68.xxx.xxx",
      "masterAccountId": "1973374733454118",
      "callerAccountId": "241009849925897811",
      "userAgent": "AlibabaCloud API Workbench",
      "vpcId": "vpc-abcd"
    },
    "authenticationInfo": {
      "signatureVersion": "unknown",
      "signatureMethod": "HMAC-SHA256",
      "authenticationType": "AK",
      "ak": "LTAI1234abcd"
    },
    "parameters": [
      {
        "name": "InstanceType",
        "value": "ecs.g6.large\n",
        "required": false,
        "type": "string"
      }
    ],
    "responses": {
      "responseBody": "{\"RequestId\":\"123E4567-E89B-12D3-A456-426614174000\",\"Code\":\"IncorrectStatus.TransitRouter\",\"Message\":\"The resource is not in a valid state for the operation.\"}",
      "responseBodyFormat": "JSON"
    }
  },
  "requestId": "9BFC4AC1-6BE4-5405-BDEC-CA288D404812"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParam.LogRequestId Please ensure that the request ID you provided originates from a request you made to a certain OpenAPI. The parameter logRequestId is invalid. Make sure that the request ID you provide originates from a request you made to a OpenAPI.
404 NotFound.RequestLog The log related to this logRequestId does not exist, has expired, or you do not have permission to view it. The log associated with this logRequestId does not exist, has expired, or you do not have permission to view it.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.