> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fluz.app/llms.txt
> Use this file to discover all available pages before exploring further.

# 刷新 OAuth 访问令牌

您可以刷新通过授权 `code` 交换获得的 accessToken。

要刷新访问令牌，请向 /token/refresh 发起请求，并携带以下查询参数：

| query param    | description             |
| -------------- | ----------------------- |
| refresh\_token | 来自授权令牌交换的 refreshToken。 |

另外，设置 Authorization 请求头，其值为将您的 client\_id:app\_secret 组合后进行 base64 编码得到的字符串。这是一个 Basic 身份验证请求头，应遵循以下格式：`Authorization: Basic <base64 encoded CLIENT_ID:CLIENT_SECRET>`

例如，如果您的 `client_id` 是 `abc123`，而 OAuth 配置中的 `client_secret` 是 `def456`，那么 base64 编码后的值将是 `YWJjMTIzOmRlZjQ1Ng==`。

`client_id` 和 `client_secret` 可在 [Configure OAuth App](/configure-o-auth-app) 的 `Overview` 选项卡中找到。

下面是一个示例 cURL 命令：

```text theme={null}
curl -X GET "https://uni.staging.fluzapp.com/token/refresh?refresh_token=<refreshToken>" -H "Authorization: Basic YWJjMTIzOmRlZjQ1Ng=="
```

响应将包含：

| query param  | description                   |
| :----------- | :---------------------------- |
| accessToken  | 用于后续访问 Fluz 后端服务的短期令牌         |
| refreshToken | 当 accessToken 过期时可使用的刷新令牌，请保存 |
| scopes       | 用户在先前流程中授予的权限值                |

以下是完整响应示例：

```json theme={null}
{"accessToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTc1MjA5NDgwNH0.0dKCtVpN0mTHHMuGNNx4VLJisTnovFNPQKhSw6zWosc","authorizationCode":"f082972eb110b80f73b0d0f95d1de9266069a1e4","accessTokenExpiresAt":"2025-07-08T21:05:30.673Z","refreshToken":"8ec16c25951616150b0332a4a6d66547","refreshTokenExpiresAt":"2025-08-08T20:55:30.738Z","scope":\["MAKE\_WIDTHDRAW","MAKE\_DEPOSIT","LIST\_PAYMENT"],"client":\{"id":"dab5c80e-0321-4c3a-988a-ffedfd64d8db","app\_id":"0a92d46e-edf4-422e-8c62-946051e5067b","app\_name":"First OAuth integration","grants":\["authorization\_code","client\_credentials","password","refresh\_token"],"redirectUris":\["http\://localhost:3035/oauth/finalize"],"accessTokenLifetime":600},"user":\{"id":"5070d5a1-d71a-4190-91b0-f116eec51771"}}
```
