会议室分组操作流程
预期效果
会议室分组展示

流程简介
1.
**result**
字段**,即会议室分组ID。**2.
3.
4.
5.
**步骤一:**创建企业内部应用

**步骤二:**获取AppKey和AppSecret

**步骤三:**添加接口权限

**步骤四:**获取应用访问凭证accessToken
public void getAccessToken() throws Exception {
Config config = new Config();
config.protocol = "https";
config.regionId = "central";
com.aliyun.dingtalkoauth2_1_0.Client client = new com.aliyun.dingtalkoauth2_1_0.Client(config);
GetAccessTokenRequest accessTokenRequest = new GetAccessTokenRequest()
.setAppKey("din*********hgn")
.setAppSecret("9G_O************mBkhgGIO");
GetAccessTokenResponse accessToken = client.getAccessToken(accessTokenRequest);
System.out.println(JSON.toJSONString(accessToken.getBody()));
}
**步骤五:**调用会议室分组相关API
1.
**result**
字段**,即会议室分组ID。**public void createRoomsGroups() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https";
config.regionId = "central";
com.aliyun.dingtalkrooms_1_0.Client client = new com.aliyun.dingtalkrooms_1_0.Client(config);
com.aliyun.dingtalkrooms_1_0.models.CreateMeetingRoomGroupHeaders createMeetingRoomGroupHeaders = new com.aliyun.dingtalkrooms_1_0.models.CreateMeetingRoomGroupHeaders();
createMeetingRoomGroupHeaders.xAcsDingtalkAccessToken = "accessToken";
com.aliyun.dingtalkrooms_1_0.models.CreateMeetingRoomGroupRequest createMeetingRoomGroupRequest = new com.aliyun.dingtalkrooms_1_0.models.CreateMeetingRoomGroupRequest()
.setUnionId("E9CS6X*******eN7QiEiE")
.setGroupName("第一分组")
.setParentGroupId(0L);
try {
CreateMeetingRoomGroupResponse meetingRoomGroupWithOptions = client.createMeetingRoomGroupWithOptions(createMeetingRoomGroupRequest, createMeetingRoomGroupHeaders, new RuntimeOptions());
System.out.println(JSON.toJSONString(meetingRoomGroupWithOptions.getBody()));
} catch (TeaException err) {
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code 和 message 属性,可帮助开发定位问题
System.out.println(err.code);
System.out.println(err.message);
}
} catch (Exception _err) {
TeaException err = new TeaException(_err.getMessage(), _err);
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code 和 message 属性,可帮助开发定位问题
System.out.println(err.code);
System.out.println(err.message);
}
}
}
2.
public void updateRoomsGroups() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https";
config.regionId = "central";
com.aliyun.dingtalkrooms_1_0.Client client = new com.aliyun.dingtalkrooms_1_0.Client(config);
com.aliyun.dingtalkrooms_1_0.models.UpdateMeetingRoomGroupHeaders updateMeetingRoomGroupHeaders = new com.aliyun.dingtalkrooms_1_0.models.UpdateMeetingRoomGroupHeaders();
updateMeetingRoomGroupHeaders.xAcsDingtalkAccessToken = "accessToken";
com.aliyun.dingtalkrooms_1_0.models.UpdateMeetingRoomGroupRequest updateMeetingRoomGroupRequest = new com.aliyun.dingtalkrooms_1_0.models.UpdateMeetingRoomGroupRequest()
.setUnionId("E9CS6X*******eN7QiEiE")
.setGroupName("我的第一分组")
.setGroupId(39L);
try {
UpdateMeetingRoomGroupResponse updateMeetingRoomGroupResponse = client.updateMeetingRoomGroupWithOptions(updateMeetingRoomGroupRequest, updateMeetingRoomGroupHeaders, new RuntimeOptions());
System.out.println(JSON.toJSONString(updateMeetingRoomGroupResponse.getBody()));
} catch (TeaException err) {
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code 和 message 属性,可帮助开发定位问题
System.out.println(err.code);
System.out.println(err.message);
}
} catch (Exception _err) {
TeaException err = new TeaException(_err.getMessage(), _err);
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code 和 message 属性,可帮助开发定位问题
System.out.println(err.code);
System.out.println(err.message);
}
}
}
3.
public void RoomsGroupsList() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https";
config.regionId = "central";
com.aliyun.dingtalkrooms_1_0.Client client = new com.aliyun.dingtalkrooms_1_0.Client(config);
com.aliyun.dingtalkrooms_1_0.models.QueryMeetingRoomGroupListHeaders queryMeetingRoomGroupListHeaders = new com.aliyun.dingtalkrooms_1_0.models.QueryMeetingRoomGroupListHeaders();
queryMeetingRoomGroupListHeaders.xAcsDingtalkAccessToken = "accessToken";
com.aliyun.dingtalkrooms_1_0.models.QueryMeetingRoomGroupListRequest queryMeetingRoomGroupListRequest = new com.aliyun.dingtalkrooms_1_0.models.QueryMeetingRoomGroupListRequest()
.setUnionId("E9CS6X*******eN7QiEiE");
try {
QueryMeetingRoomGroupListResponse queryMeetingRoomGroupListResponse = client.queryMeetingRoomGroupListWithOptions(queryMeetingRoomGroupListRequest, queryMeetingRoomGroupListHeaders, new RuntimeOptions());
System.out.println(JSON.toJSONString(queryMeetingRoomGroupListResponse.getBody()));
} catch (TeaException err) {
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code 和 message 属性,可帮助开发定位问题
System.out.println(err.code);
System.out.println(err.message);
}
} catch (Exception _err) {
TeaException err = new TeaException(_err.getMessage(), _err);
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code 和 message 属性,可帮助开发定位问题
System.out.println(err.code);
System.out.println(err.message);
}
}
}
4.
public void RoomsGroupsInfo() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https";
config.regionId = "central";
com.aliyun.dingtalkrooms_1_0.Client client = new com.aliyun.dingtalkrooms_1_0.Client(config);
com.aliyun.dingtalkrooms_1_0.models.QueryMeetingRoomGroupHeaders queryMeetingRoomGroupHeaders = new com.aliyun.dingtalkrooms_1_0.models.QueryMeetingRoomGroupHeaders();
queryMeetingRoomGroupHeaders.xAcsDingtalkAccessToken = "accessToken";
com.aliyun.dingtalkrooms_1_0.models.QueryMeetingRoomGroupRequest queryMeetingRoomGroupRequest = new com.aliyun.dingtalkrooms_1_0.models.QueryMeetingRoomGroupRequest()
.setUnionId("E9CS6X*******eN7QiEiE");
try {
QueryMeetingRoomGroupResponse queryMeetingRoomGroupResponse = client.queryMeetingRoomGroupWithOptions("39", queryMeetingRoomGroupRequest, queryMeetingRoomGroupHeaders, new RuntimeOptions());
System.out.println(JSON.toJSONString(queryMeetingRoomGroupResponse.getBody()));
} catch (TeaException err) {
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code 和 message 属性,可帮助开发定位问题
System.out.println(err.code);
System.out.println(err.message);
}
} catch (Exception _err) {
TeaException err = new TeaException(_err.getMessage(), _err);
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code 和 message 属性,可帮助开发定位问题
System.out.println(err.code);
System.out.println(err.message);
}
}
}
5.
public void deleteRoomsGroups() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https";
config.regionId = "central";
com.aliyun.dingtalkrooms_1_0.Client client = new com.aliyun.dingtalkrooms_1_0.Client(config);
com.aliyun.dingtalkrooms_1_0.models.DeleteMeetingRoomGroupHeaders deleteMeetingRoomGroupHeaders = new com.aliyun.dingtalkrooms_1_0.models.DeleteMeetingRoomGroupHeaders();
deleteMeetingRoomGroupHeaders.xAcsDingtalkAccessToken = "accessToken";
com.aliyun.dingtalkrooms_1_0.models.DeleteMeetingRoomGroupRequest deleteMeetingRoomGroupRequest = new com.aliyun.dingtalkrooms_1_0.models.DeleteMeetingRoomGroupRequest()
.setUnionId("E9CS6X*******eN7QiEiE");
try {
DeleteMeetingRoomGroupResponse deleteMeetingRoomGroupResponse = client.deleteMeetingRoomGroupWithOptions("40", deleteMeetingRoomGroupRequest, deleteMeetingRoomGroupHeaders, new RuntimeOptions());
System.out.println(JSON.toJSONString(deleteMeetingRoomGroupResponse.getBody()));
} catch (TeaException err) {
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code 和 message 属性,可帮助开发定位问题
System.out.println(err.code);
System.out.println(err.message);
}
} catch (Exception _err) {
TeaException err = new TeaException(_err.getMessage(), _err);
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err 中含有 code 和 message 属性,可帮助开发定位问题
System.out.println(err.code);
System.out.println(err.message);
}
}
}
修改于 2024-01-16 08:14:26