# 查询内推账户

根据账户 ID 查询内推账户信息。

## 请求

基本 | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/hire/v1/referral_account/get_account_assets
HTTP Method | GET
接口频率限制 | [10 次/秒](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
支持的应用类型 | Custom App、Store App
权限要求<br>**调用该 API 所需的权限。开启其中任意一项权限即可调用**<br>开启任一权限即可 | 更新内推账号信息(hire:referral_account)<br>获取内推账户信息(hire:referral_account:readonly)
字段权限要求 | **注意事项**：该接口返回体中存在下列敏感字段，仅当开启对应的权限后才会返回；如果无需获取这些字段，则不建议申请<br>获取用户 user ID(contact:user.employee_id:readonly)<br>查看员工邮箱(hire:employee.email:readonly)<br>查看员工手机号(hire:employee.mobile:readonly)

### 请求头

名称 | 类型 | 必填 | 描述
---|---|---|---
Authorization | string | 是 | `tenant_access_token`<br>**值格式**："Bearer `access_token`"<br>**示例值**："Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[了解更多：如何选择与获取 access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)

### 查询参数

名称 | 类型 | 必填 | 描述
---|---|---|---
referral_account_id | string | 是 | 账户 ID，注册账户后获取：[注册内推账户](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral_account/create)<br>**示例值**：6942778198054125570
user_id_type | string | 否 | 用户 ID 类型<br>**示例值**：open_id<br>**可选值有**：<br>- open_id：标识一个用户在某个应用中的身份。同一个用户在不同应用中的 Open ID 不同。[了解更多：如何获取 Open ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-openid)<br>- union_id：标识一个用户在某个应用开发商下的身份。同一用户在同一开发商下的应用中的 Union ID 是相同的，在不同开发商下的应用中的 Union ID 是不同的。通过 Union ID，应用开发商可以把同个用户在多个应用中的身份关联起来。[了解更多：如何获取 Union ID？](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-union-id)<br>- user_id：标识一个用户在某个租户内的身份。同一个用户在租户 A 和租户 B 内的 User ID 是不同的。在同一个租户内，一个用户的 User ID 在所有应用（包括商店应用）中都保持一致。User ID 主要用于在不同的应用间打通用户数据。[了解更多：如何获取 User ID？](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-user-id)<br>**默认值**：`open_id`<br>**当值为 `user_id`，字段权限要求**：<br>获取用户 user ID(contact:user.employee_id:readonly)

## 响应

### 响应体

名称 | 类型 | 描述
---|---|---
code | int | 错误码，非 0 表示失败
msg | string | 错误描述
data | \- | \-
account | account | 账户信息
account_id | string | 账户 ID
assets | assets | 账户资产
confirmed_bonus | bonus_amount | 已确认的奖励
point_bonus | int | 积分奖励
cash_bonus | cash\[\] | 现金奖励
currency_type | string | 币种，详情可查看：[枚举常量介绍](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/enum)中「币种（currency）枚举定义」
amount | number(float) | 数额，保留到小数点后两位
status | int | 账户状态<br>**可选值有**：<br>- 1：可用<br>- 2：停用
referrer | account_referrer | 账户绑定的内推人信息
id | string | 内推人 ID，与入参`user_id_type`类型一致
name | i18n | 内推人名称
zh_cn | string | 内推人中文名称
en_us | string | 内推人英文名称
email | string | 内推人邮箱<br>**字段权限要求**：<br>查看员工邮箱(hire:employee.email:readonly)
mobile | string | 内推人手机<br>**字段权限要求**：<br>查看员工手机号(hire:employee.mobile:readonly)

### 响应体示例
```json
{
    "code": 0,
    "msg": "SUCCESS",
    "data": {
        "account": {
            "account_id": "6942778198054125570",
            "assets": {
                "confirmed_bonus": {
                    "point_bonus": 100,
                    "cash_bonus": [
                        {
                            "currency_type": "CNY",
                            "amount": 100
                        }
                    ]
                }
            },
            "status": 1,
            "referrer": {
                "id": "7413952589321914668",
                "name": {
                    "zh_cn": "张三",
                    "en_us": "zhangSan"
                },
                "email": "27188272xxxx1.com",
                "mobile": "1879087xxx8"
            }
        }
    }
}
```

### 错误码

HTTP状态码 | 错误码 | 描述 | 排查建议
---|---|---|---
500 | 1002001 | 系统错误 | 请根据实际报错信息定位或咨询[技术支持](https://applink.feishu.cn/TLJpeNdW)
400 | 1002002 | 参数错误 | 请根据实际报错信息定位或咨询[技术支持](https://applink.feishu.cn/TLJpeNdW)
400 | 1002553 | 账户不存在 | 请注册内推账户：[注册内推账户](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral_account/create)

