生成访问码
POST
/web/v1/workspaces/{workspaceId}/institutions/{institutionBizId}/portals/portal-types/{portalType}/access-code/generateWEB为指定的 Portal 类型生成新的访问码。如果已存在访问码,将被替换。
鉴权
需要有效的 JWT token。网关验证:enableJwtToken=true,enableTurnstile=false。
请求参数
路径参数
| Name | Type | Required | In | Description |
|---|---|---|---|---|
workspaceId | string | Yes | path | 工作空间业务 ID |
institutionBizId | string | Yes | path | 机构业务 ID |
portalType | integer | Yes | path | Portal 类型代码(例如:10010101=system、10010102=tenant) |
成功响应
成功200
{
"code": "2000",
"message": "SUCCESS",
"data": {
"accessCode": "pac_xxxx1234abcd",
"institutionBizId": "inst_abc123",
"portalType": 10010102,
"expiresAt": "2026-06-21T00:00:00Z",
"rotatingCode": null,
"rotatingCodeExpiresAt": null
}
}错误响应
| 错误码 | 描述 |
|---|---|
4010 | 未授权(无效或缺少 JWT token) |
4040 | Portal 未找到 |
说明
- 新生成的访问码在响应中以明文返回。
- 生成新码后,之前的访问码将失效。