{
  "tags": [
    "网站监控"
  ],
  "description": "按 Elasticsearch 文档 ID 获取访问日志的请求头、响应头和请求体。接口要求登录。普通用户仅能读取日志中 uid 与自身相同的记录；管理员可读取任何记录。当前服务端直接取查询结果首项，日志 ID 不存在时没有标准业务错误封装，可能返回服务端异常。",
  "operationId": "user_get_v1_monitor_site_access_log_id",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "成功和普通用户越权均使用 HTTP 200。缺失的 `req_header`、`resp_header` 或 `req_body` 统一返回空字符串。",
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "integer",
                    "enum": [
                      0
                    ],
                    "description": "0 表示查询成功。"
                  },
                  "msg": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "成功时固定为空字符串。"
                  },
                  "data": {
                    "type": "object",
                    "description": "指定访问日志记录中保存的原始请求与响应内容。",
                    "required": [
                      "req_header",
                      "resp_header",
                      "req_body"
                    ],
                    "properties": {
                      "req_header": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          }
                        ],
                        "description": "日志原始请求头；字段未记录时为空字符串。对象形式的键为 HTTP 头名称、值为对应头值。"
                      },
                      "resp_header": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          }
                        ],
                        "description": "日志原始响应头；字段未记录时为空字符串。对象形式的键为 HTTP 头名称、值为对应头值。"
                      },
                      "req_body": {
                        "type": "string",
                        "description": "日志原始请求体；字段未记录时为空字符串。"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "access_log_detail-1",
                      "login_required"
                    ],
                    "description": "普通用户访问其他用户日志或认证失败时返回。"
                  },
                  "msg": {
                    "type": "string",
                    "description": "权限不足或认证失败的具体原因。"
                  },
                  "data": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "业务错误时为空字符串。"
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "examples": {
            "success": {
              "summary": "查询成功",
              "value": {
                "code": 0,
                "msg": "",
                "data": {
                  "req_header": {
                    "host": "www.example.invalid",
                    "user-agent": "curl/8"
                  },
                  "resp_header": {
                    "content-type": "text/html"
                  },
                  "req_body": ""
                }
              }
            },
            "forbidden": {
              "summary": "访问其他用户日志",
              "value": {
                "code": "access_log_detail-1",
                "msg": "无权限",
                "data": ""
              }
            }
          },
          "example": {
            "code": 0,
            "msg": "",
            "data": {
              "req_header": {
                "host": "www.example.invalid",
                "user-agent": "curl/8"
              },
              "resp_header": {
                "content-type": "text/html"
              },
              "req_body": ""
            }
          }
        }
      }
    }
  },
  "x-python-handler": "monitor.AccessLogDetailAPI",
  "x-python-route-line": 784,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "访问日志 Elasticsearch 文档 ID。",
      "example": "REDACTED_LOG_ID"
    }
  ],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "monitor.AccessLogDetailAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 784
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "get",
  "path": "/v1/monitor/site/access-log/{id}",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "AccessToken": {
      "type": "apiKey",
      "in": "header",
      "name": "access-token",
      "description": "通过登录接口获得的短期访问令牌。"
    },
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "api-key",
      "description": "API Key；必须和 api-secret 同时发送。"
    },
    "ApiSecret": {
      "type": "apiKey",
      "in": "header",
      "name": "api-secret",
      "description": "API Secret；必须和 api-key 同时发送。"
    }
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "获取访问日志请求详情",
    "description": {
      "content": "按 Elasticsearch 文档 ID 获取访问日志的请求头、响应头和请求体。接口要求登录。普通用户仅能读取日志中 uid 与自身相同的记录；管理员可读取任何记录。当前服务端直接取查询结果首项，日志 ID 不存在时没有标准业务错误封装，可能返回服务端异常。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "monitor",
        "site",
        "access-log",
        ":id"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": [
        {
          "disabled": false,
          "description": {
            "content": "(Required) 访问日志 Elasticsearch 文档 ID。",
            "type": "text/plain"
          },
          "type": "any",
          "value": "",
          "key": "id"
        }
      ]
    },
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "GET",
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}