Backend Development 5 min read

Implementing WeChat Work Schedule Synchronization in the Enterprise Messaging Center

The Enterprise Messaging Center now offers a reusable component that integrates WeChat Work’s schedule API, enabling add, update, and delete operations, exposing CRUD interfaces for external systems such as the meeting‑room platform, streamlining schedule synchronization and reducing duplicate data entry across services.

37 Interactive Technology Team
37 Interactive Technology Team
37 Interactive Technology Team
Implementing WeChat Work Schedule Synchronization in the Enterprise Messaging Center

Preface: It is assumed that users are familiar with the WeChat Work schedule feature, which serves as a time‑management tool, acting both as a reminder and a way to improve work efficiency.

In daily work, many people schedule meetings by first booking a meeting room, then adding time, location, participants, and finally duplicating the same information in the schedule application. To address this pain point, the meeting‑room system will soon support synchronizing with the schedule feature.

The implementation is packaged as a reusable component within the Enterprise Messaging Center, providing a basic module for external systems to integrate the WeChat Work schedule functionality.

Implementation

1. Review the WeChat Work schedule integration documentation: https://developer.work.weixin.qq.com/document/path/93648

2. Integrate the WeChat Work schedule API. The steps include determining the target application, obtaining the application token, and constructing the request payload.

$wechatClass = new wechat\wechat();
// Schedule application ID
$wechatClass->setAppID(MESSAGE_APP_ID);
// Call interface credential
$accessToken = $wechatClass->checkToken();

(2) Assemble the data structure for the request.

$postData = array();
$url = "";
if (strval($operateType) == 'del') {
    // Delete
    $postData['schedule_id'] = $scheduleId;
    // API endpoint
    $url = URL_POST_SCHEDULE_DEL . '?access_token=' . $accessToken;
} else {
    // Add or Update
    $postData['schedule']['admins'] = $organizer;
    $postData['schedule']['start_time'] = $startTime;
    $postData['schedule']['end_time'] = $endTime;
    $postData['schedule']['attendees'] = $attendeesData;
    $postData['schedule']['summary'] = $summary;
    $postData['schedule']['description'] = $description;
    $postData['schedule']['location'] = $location;

    if (strval($operateType) == 'add') {
        // Add endpoint
        $url = URL_POST_SCHEDULE_ADD . '?access_token=' . $accessToken;
    } elseif (strval($operateType) == 'update') {
        // Update requires schedule_id
        $postData['schedule']['schedule_id'] = $scheduleId;
        $url = URL_POST_SCHEDULE_UPDATE . '?access_token=' . $accessToken;
    }
}

(3) Call the WeChat Work API.

$result = curlRequest($url, $postData, true, true);

3. Refactor the Enterprise Messaging Center to expose new schedule CRUD interfaces, allowing other systems to reuse the basic components (messages, schedules, emails, etc.) without handling the WeChat Work interaction themselves.

The new APIs have already been integrated with the meeting‑room system and are operating normally. The overall integration flow follows the same pattern as previous WeChat Work message integrations.

Figure 1 (below) illustrates the integration flow, and Figure 2 shows the actual effect in the UI.

Summary

Because the Enterprise Messaging Center already has foundational integration with WeChat Work, connecting to the schedule API is relatively straightforward. The center acts as a bridge, and we will continue to improve basic components such as messages, schedules, and emails to facilitate easier integration for other services. Teams with business needs can contact us for assistance.

Backend IntegrationPHPAPI DevelopmentEnterprise MessagingSchedule APIWeChat Work
37 Interactive Technology Team
Written by

37 Interactive Technology Team

37 Interactive Technology Center

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.