# Get Employee HRBP/Location BP

Get employee's HRBP and Location BP, including HRBP and Location BP from superior department.
**Notice**：This interface will return data according to the permission scope of the "Employee Resources" owned by the application. Please make sure you have applied for the "Employee Resources" permission in "Developer Backend - Permission Management - Data Permissions - Feishu Personnel (Enterprise Edition) Data Permission Scope" scope.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/corehr/v2/employees/bps/batch_get
HTTP Method | POST
Rate Limit | [100 per minute](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App、Store App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.** | View part of employee's BP information(corehr:employee.bp:read)
Required field scopes | **Notice**：The response body of the API contains the following sensitive fields, and they will be returned only after corresponding scopes are added. If you do not need the fields, it is not recommended that you request the scopes.<br>View all of employee's BP information(corehr:employee.all_bp:read)<br>Obtain user ID(contact:user.employee_id:readonly)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

### Query parameters

Parameter | Type | Required | Description
---|---|---|---
user_id_type | string | No | User ID categories<br>**Example value**: open_id<br>**Optional values are**:<br>- open_id：Identifies a user to an app. The same user has different Open IDs in different apps. [How to get Open ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-openid)<br>- union_id：Identifies a user to a tenant that acts as a developer. A user has the same Union ID in apps developed by the same developer, and has different Union IDs in apps developed by different developers. A developer can use Union ID to link the same user's identities in multiple apps.[How to get Union ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-union-id)<br>- user_id：Identifies a user to a tenant. The same user has different User IDs in different tenants. In one single tenant, a user has the same User ID in all apps （including store apps）. User ID is usually used to communicate user data between different apps. [How to get User ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-user-id)<br><md-enum-item key="people_corehr_id" ><br>**Default value**: `open_id`<br>**When the value is `user_id`, the following field scopes are required**:<br>Obtain user ID(contact:user.employee_id:readonly)

### Request body

Parameter | Type | Required | Description
---|---|---|---
employment_ids | string\[\] | Yes | Employee ID, ID type has the same value meaning as user_id_type.<br>><br>If you need to use the job number, you can use [ID conversion service](https://open.larkoffice.com/document/server-docs/corehr-v1/common_data-id/search?appId=cli_9c04f2177d799101) in exchange for ==employment_id==<br>**Example value**: ["7140964208476371111"]<br>**Data validation rules**:<br>- Length range: `1` ～ `100`
get_all | boolean | No | Whether to get all BP. True is to get all HRBP and Location BP of the employee's department and from the superior department, false is to get only the employee's direct HRBP and Location BP (when there is no BP in the employee's department and location, it will drill up to find the nearest BP). The default is false.<br>**Example value**: true<br>**Default value**: `false`

### Request body example
```json
{
    "employment_ids": [
        "7140964208476371111"
    ],
    "get_all": true
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
employment_direct_bps | employment_bp\[\] | BP information directly under the employee. When there is no BP in the employee's department or location, it will drill up to find the nearest BP.
employment_id | string | Employment ID
hrbp_ids | string\[\] | Direct HRBP Employment ID
location_bp_ids | string\[\] | Direct Location BP employment ID
employment_all_bps | employment_bp\[\] | All BP information of employees<br>**Required field scopes**:<br>View all of employee's BP information(corehr:employee.all_bp:read)
employment_id | string | Employee Employment ID
hrbp_ids | string\[\] | All employment IDs of HRBP from employee's department and superior department
location_bp_ids | string\[\] | All employment IDs of Location BP from employee's department and superior department

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "employment_direct_bps": [
            {
                "employment_id": "6863326262618752123",
                "hrbp_ids": [
                    "6863326262618752123"
                ],
                "location_bp_ids": [
                    "6863326262618752123"
                ]
            }
        ],
        "employment_all_bps": [
            {
                "employment_id": "6863326262618752123",
                "hrbp_ids": [
                    "6863326262618752123"
                ],
                "location_bp_ids": [
                    "6863326262618752123"
                ]
            }
        ]
    }
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 1161401 | Incorrect parameter type | Please check the parameter types, such as string and number
400 | 1161402 | Incorrect parameter range | Please check if the numeric parameters are within the specified range
400 | 1161403 | Incorrect parameter length | Please check parameters of the container type, such as List and Map
400 | 1161404 | Missing or invalid parameter | Please check if the parameters are valid
400 | 1161405 | Parameter parsing error | Please check the JSON format of the request body
400 | 1161406 | Parameter exceeds the optional range | Please check the available options for parameters of the enumeration type
500 | 1161501 | System internal error | Please contact [technical support](https://applink.feishu.cn/TLJpeNdW)

