Search in sources :

Example 1 with OapiV2DepartmentGetRequest

use of com.dingtalk.api.request.OapiV2DepartmentGetRequest in project MaxKey by dromara.

the class DingtalkOrganizationService method requestDepartment.

public OapiV2DepartmentGetResponse requestDepartment(String access_token, Long deptId) throws ApiException {
    DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/get");
    OapiV2DepartmentGetRequest req = new OapiV2DepartmentGetRequest();
    req.setDeptId(deptId);
    req.setLanguage("zh_CN");
    OapiV2DepartmentGetResponse rspDepts = client.execute(req, access_token);
    _logger.trace("response : " + rspDepts.getBody());
    return rspDepts;
}
Also used : DefaultDingTalkClient(com.dingtalk.api.DefaultDingTalkClient) OapiV2DepartmentGetRequest(com.dingtalk.api.request.OapiV2DepartmentGetRequest) OapiV2DepartmentGetResponse(com.dingtalk.api.response.OapiV2DepartmentGetResponse) DefaultDingTalkClient(com.dingtalk.api.DefaultDingTalkClient) DingTalkClient(com.dingtalk.api.DingTalkClient)

Aggregations

DefaultDingTalkClient (com.dingtalk.api.DefaultDingTalkClient)1 DingTalkClient (com.dingtalk.api.DingTalkClient)1 OapiV2DepartmentGetRequest (com.dingtalk.api.request.OapiV2DepartmentGetRequest)1 OapiV2DepartmentGetResponse (com.dingtalk.api.response.OapiV2DepartmentGetResponse)1