GET读取会员与企业资料
/profile需要密钥 · 需要权限 profile:read
返回当前密钥所属会员和企业的基础资料。需要 profile:read 权限。密钥绑定的会员或企业不存在时返回 404(detail 为文字说明)。
返回
200会员与企业资料。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
data | object | 否 | — |
data.user | object | 否 | — |
data.user.id | integer | 否 | — |
data.user.username | string | null | 否 | — |
data.user.nickname | string | null | 否 | — |
data.user.real_name | string | null | 否 | — |
data.user.email | string | null | 否 | — |
data.user.mobile | string | null | 否 | — |
data.enterprise | object | 否 | — |
data.enterprise.id | integer | 否 | — |
data.enterprise.name | string | null | 否 | — |
data.enterprise.short_name | string | null | 否 | — |
data.enterprise.industry_type | string | null | 否 | — |
data.enterprise.business_type | string | null | 否 | — |
tenant_id | integer | 否 | 密钥绑定的企业编号。 |
{
"data": {
"user": {
"id": 20,
"username": "demo_user",
"nickname": "示例会员",
"real_name": "示例姓名",
"email": "user@example.com",
"mobile": "13800000000"
},
"enterprise": {
"id": 10,
"name": "示例企业有限公司",
"short_name": "示例企业",
"industry_type": "示例行业",
"business_type": "示例类型"
}
},
"tenant_id": 10
}401未提供有效的 API 密钥(invalid_api_key),或密钥上下文无效(invalid_api_context)。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
detail | object | 是 | — |
detail.code | string | 是 | 错误代码,程序判断用。 |
detail.message | string | 是 | 中文说明。 |
detail.details | object | 否 | 部分错误带的补充信息,例如版本冲突时的 current_version。 |
403密钥已撤销、过期或申请未获批准(api_key_inactive);申请主体不一致(api_actor_mismatch);会员、企业或成员关系已停用(api_actor_inactive);密钥没有该接口需要的权限(api_scope_denied);或业务规则拒绝,例如自动派单授权无效。
返回字段同 401。
404资源不存在或不属于当前密钥;路由不存在或请求方法不对时 code 为 member_api_route_not_found。
返回字段同 401。
429当前密钥每分钟请求次数已达上限(120 次)。
返回字段同 401。
错误返回的格式和重试建议见 错误处理。
调用示例
curl -X GET 'https://www.zhugejunshi.com/api/member-api/v1/profile' \
-H 'X-Zhuge-API-Key: YOUR_API_KEY'在线调试
这里会用你填的密钥向正式接口发一次真实请求。密钥只留在本页内存里,不保存、不上传到别处,刷新页面后要重新填写。