Updated on 2024-09-13 GMT+08:00

Scheduling a Recurring Meeting Series

BookCycleConf

API Description

This API is used to schedule a recurring meeting series.

Precautions

  1. Call this API after login.
  2. This API is an asynchronous API. The return value only indicates whether the API is successfully called. The actual service processing result is returned in the corresponding callback function.
  3. The meeting start time must be later than the current time, and the meeting duration must be longer than 15 minutes.
  4. The attendees parameter must be passed if participant information needs to be carried.
  5. The maximum time span of a recurring meeting series is one year. The number of recurring meetings in a series cannot exceed 50. Otherwise, only the first 50 meetings are scheduled.
  6. The callback function returns details about scheduled meetings. For details, see HwmConfDetail. If only meeting IDs are returned, meeting details fail to be obtained.

Method Definition

1
HWM_SDK_AGENT_API hwmsdk::HwmErrCode BookCycleConf(const HwmBookCycleConfParam *bookCycleConfParam);

Callback Function

1
virtual void OnBookCycleConfResult(hwmsdk::HwmErrCode ret, const char* reason, const HwmConfDetail* confDetail) {};

Parameter Description

Table 1 HwmBookCycleConfParam description

Parameter

Mandatory

Type

Description

bookCycleConfParam

Yes

HwmBookConfParam

Parameters for scheduling the recurring meeting series.

cycleParam

Yes

HwmCycleConfParam

Recurring meeting series parameters.

Table 2 HwmCycleConfParam description

Parameter

Mandatory

Type

Description

startDate

Yes

long long

Start date and timestamp, accurate to seconds (GMT).

endDate

Yes

long long

End date and timestamp, accurate to seconds (GMT).

cycleType

Yes

HwmCycleType

Period type.

interval

Yes

unsigned int

Interval of recurring meetings.

1. If cycleType is set to daily, there is a meeting every several days. The value range is [1,15].

2. If cycleType is set to weekly, there is a meeting every several weeks. The value range is [1,5].

3. If cycleType is set to monthly, there is a meeting every several months. The value range is [1,3].

listPoints

Yes

char[]

Point for holding recurring meetings. This parameter is valid only when meetings are held weekly or monthly. Values are separated by colons (,), for example, 1,3,5,7.

- Weekly: The value range is [0,6]. 0 indicates Sunday, 1 indicates Monday, and so on.

- Monthly: The value range is [1,31]. If the specified maximum value exceeds the number of days in a given month, the system will interpret it as referring to the last day of that month.

preRemindDays

Yes

unsigned int

Number of days in advance users are notified of a recurring meeting.

Table 3 Enumerated values of HwmCycleType

Enumerated Value

Description

CYCLE_TYPE_DAY

Daily.

CYCLE_TYPE_WEEK

Weekly.

CYCLE_TYPE_MONTH

Monthly.

Sample Code

 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
35
36
37
38
39
40
41
42
43
44
45
46
/**
* Schedule a meeting.
*/
int CdemoBookConfDlg::OnBnClickedBookCycleConf()
{
    hwmsdkagent::HwmBookConfParam data{};
    strncpy_s(data.subject, GetConfSubject().c_str(), HWM_MAX_SUBJECT_LEN); // UTF-8 string
    data.confType = hwmsdkagent::HwmConfMediaType::HWM_VIDEO_AND_DATA;
    data.isNeedConfPwd = true;
    data.isAutoRecordOn = true;
    data.isRecordOn = true;
    data.startTime = 1633017600; // UTC timestamp, in seconds. If the obtained time is the local time, the time needs to be converted to the UTC time.
    data.duration = 30; // Meeting duration, in minutes
    data.timeZone = 56; // Time zone. The value 56 indicates GMT+08:00.
    data.joinConfRestrictionType = hwmsdkagent::HwmJoinConfPermissionType::RESTRICTION_CALL_IN_ALL;
    
    std::vector<hwmsdkagent::HwmAttendeeInfo> attendeeList;
    // Participants to invite
    hwmsdkagent::HwmAttendeeInfo attendeeInfo{};
    strncpy_s(attendeeInfo.name, GetAttName().c_str(), HWM_MAX_USER_NAME_LEN);
    strncpy_s(attendeeInfo.number, GetAttNumber().c_str(), HWM_MAX_NUMBER_LEN);
    strncpy_s(attendeeInfo.email, GetAttEmail().c_str(), HWM_MAX_EMAIL_LEN);
    strncpy_s(attendeeInfo.sms, GetAttSms().c_str(), HWM_MAX_PHONE_NUM_LEN);
    strncpy_s(attendeeInfo.thirdUserId, GetAttUserId().c_str(), HWM_MAX_USER_ID_LEN);
    attendeeInfo.isMute = true;
    attendeeInfo.isAutoInvite = true;
    attendeeList.push_back(attendeeInfo);
 
    data.attendees = attendeeList.data();
    data.attendeeLen = attendeeList.size(); 
    data.isSmsOn = true;
    data.isMailOn = true;
    data.isEmailCalendarOn = true;

    hwmsdkagent::HwmCycleConfParam cycleConfParam{};
    cycleConfParam.startDate = 1633017600; // UTC timestamp, in seconds. If the obtained time is the local time, the time needs to be converted to the UTC time.
    cycleConfParam.endDate= 1636560000; // UTC timestamp, in seconds. If the local time is obtained, convert it to the UTC time.
    cycleConfParam.cycleType = hwmsdkagent::CYCLE_TYPE_WEEK;
    strcpy_s(cycleConfParam.listPoints, sizeof(cycleConfParam.listPoints), "1,5"); // Every Monday and Friday
    cycleConfParam.preRemindDays = 1;

    hwmsdkagent::HwmBookCycleConfParam bookCycleConfParam{};
    bookCycleConfParam.bookConfParam = data;
    bookCycleConfParam.cycleParam = cycleConfParam;
    return hwmsdkagent::BookCycleConf(&bookCycleConfParam);
}