Updated on 2023-03-23 GMT+08:00

Scenario 4: Editing a Meeting

Description

After a meeting is scheduled, you can use the meeting modification API to edit the meeting details and add participants.

Service Process

To edit a meeting after the meeting list is obtained, call the getConfDetail API to query the meeting details, process the details in the API callback onGetConfDetailResult, call the editConf API to modify the meeting details, and implement the API callback function onEditConfResult and the subscribed-to onConfListChanged notification.

  1. Obtain meeting details.

    1. Assemble the data structure GetConfDetailParam and the API callback function onGetConfDetailResult.
    2. Call the GetConfDetail API. The data in the preceding step is used as input parameters.

  2. Implement the callback function.

    Implement the onGetConfDetailResult function to obtain the meeting details.

  3. Call the API for editing the meeting.

    1. Use the data obtained in step 2 to assemble the data structure EditConfParam (including Array<AttendeeBaseInfo> in the structure) and the callback function onEditConfResult.
    2. Call the editConf API. The data in the preceding step is used as input parameters.

  4. Implement the callback function.

    Implement the onEditConfResult function.

  5. Implement the notification function.

    Implement the onConfListChanged function.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
/**
* Obtain meeting details.
*/
async getConfInfoById(confId) {
    let param = {
        confId: "989156631",
    }
    const apiService = new ApiService();
    let setResult = await apiService.getConfDetail(param);
    if (setResult.ret == 0) {
        let _data = setResult.confDetail;
        console.log("confDetail:", _data);
      // The code for caching meeting details is omitted here.

    } else {
        window.electron.ipcRenderer.send("show-error-alert", "getConfDetail error = " + setResult.ret);
    }
}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
/**
* Definition of getConfDetail API in ApiService
*/
async getConfDetail(getConfDetailParam) {
    return new Promise((resolve) => {
      let resultCallback = (ret, reason, confDetail) => {
        console.log("getConfDetail, out data = ", { ret, reason, confDetail });
        resolve({ ret, reason, confDetail });
      };
      console.log("getConfDetail, in param = ", getConfDetailParam);
      this.uisdkService.getConfMgrApi().getConfDetail(getConfDetailParam, resultCallback);
    });
}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Edit a meeting.
*/
async editConf() {
    // According to the cache, meeting details are stored in state. Obtain meeting details from state.
    let { confId, subject, startTime, duration, mediaType, needPassword, timezone, vmrFlag, vmrId, confAllowJoinUser, isSendSms, isSendEmail,
        isSendCalendar, attendees, isAutoRecord, isOpenWaitingRoom, vmrConfId } = this.state;
    let _attendees = attendees ? JSON.parse(attendees) : "";
    let param = {
        confId: confId,
        startTime: 1598398920, // UTC timestamp.
        duration: 0 * 60 + 30, // Meeting duration.
        isSendCalendar: isSendCalendar,
        confCommonParam: {
            subject: subject,
            mediaType: mediaType,
            needPassword: needPassword,
            timezone: 56, // Local time zone. The value 56 indicates GMT+08:00.
            vmrId: vmrId,
            vmrConfIdType: (vmrConfId != "") ? 0 : 1,
            confAllowJoinUser: ConfAllowJoinUserType.CONF_ALLOW_JOIN_ANYONE, // Obtain the type of users allowed to join the meeting.
            isSendSms: isSendSms,
            isSendEmail: isSendEmail,
            attendees: _attendees,
            isAutoRecord: false; // By default, automatic recording is disabled.
            isOpenWaitingRoom: isOpenWaitingRoom,
        }
    }
    const apiService = new ApiService();
    let setResult = await apiService.editConf(param);
    if (setResult.ret != 0) {
        window.electron.ipcRenderer.send("show-error-alert", "editConf error = " + setResult.ret);
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
/**
* Definition of editConf API in ApiService
*/
async editConf(editConfParam) {
  return new Promise((resolve) => {
    let resultCallback = (ret, reason) => {
      console.log("editConf, out data = ", { ret, reason });
      resolve({ ret, reason });
    };
    console.log("editConf, in param = ", editConfParam);
    this.uisdkService.getConfMgrApi().editConf(editConfParam, resultCallback);
  });
}

The onConfListChanged event notification scenario is the same as the meeting scheduling scenario. For details, see Sample Code.