---
updatedAt: 2026-04-21T06:45:46.000Z
agentTools:
  projectIndex: https://developer.qbitnetwork.com/llms.txt
---

# 获取授权码

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "核心资源",
    "description": "接口开发者文档",
    "version": "v3"
  },
  "externalDocs": {
    "description": "接口开发者",
    "url": "https://developer.qbitnetwork.com/"
  },
  "servers": [
    {
      "url": "https://api-sandbox.qbitnetwork.com",
      "description": "沙箱环境"
    }
  ],
  "paths": {
    "/open-api/v3/oauth/authorize": {
      "get": {
        "tags": [
          "认证"
        ],
        "summary": "获取授权码",
        "operationId": "getCode",
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "description": "客户端ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodeRespDTO"
                },
                "example": {
                  "code": "000000",
                  "message": "success",
                  "data": {
                    "timestamp": 1758169260,
                    "code": "8655cf76c744615b57e631216ee006df"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResult"
                },
                "example": {
                  "code": "40001",
                  "message": "Invalid parameter"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResult": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "错误码",
            "example": "400001"
          },
          "message": {
            "type": "string",
            "description": "错误信息",
            "example": "参数无效"
          }
        }
      },
      "CodeRespDTO": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "错误码",
            "example": "400001"
          },
          "message": {
            "type": "string",
            "description": "错误信息",
            "example": "参数无效"
          },
          "data": {
            "$ref": "#/components/schemas/CodeRespData"
          }
        }
      },
      "CodeRespData": {
        "required": [
          "code",
          "timestamp"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "用于换取访问令牌的临时代码（code），仅可使用一次；若10分钟内未使用将自动失效"
          },
          "timestamp": {
            "type": "integer",
            "description": "响应时间戳",
            "format": "int64"
          }
        }
      }
    }
  }
}
```