Expected result
After an event is created, the result is as follows:Integration flow overview
This document demonstrates how to create an internal app and then use the APIs provided by Calendar to create, modify, query the details of a single event, and delete an event. Prerequisite: Complete the Create and configure an app flow. Step 1: Obtain the app credential information, including the client ID and Client Secret. Step 2: Request API permissions for the Calendar-related APIs. Step 3: Obtain the app access credential Obtain the access token of an internal app. When calling an API, use the access token to authenticate the caller. Step 4: Call the Server API for Calendar:- Call the Server API New Event to create an event. Obtain the event
id. - Based on the event
id, call the Server API Modify event to modify the event information. - Based on the event
id, call the Server API Query details about an event to obtain the event details. - Based on the event
id, call the Server API Delete Event to delete the created event.
Prerequisites
Complete the Create and configure an app flow.Step 1: Obtain the app credential
- Select the target app to enter the app details page, then click Basic information > Credentials and basic information.
- Obtain the client ID and Client Secret.
Step 2: Add API permissions
Click Development configuration > Manage permissions. In the permission search box, enterCalendar.Event.Write and Calendar.Event.Read respectively, and request the permissions.
Step 3: Obtain the app access token
Use the client ID and Client Secret from Step 1 to obtain the access_token of an internal app.Step 4: Call the Server API for Calendar
-
Call the Server API New Event to create an event. Obtain the event
id. -
Based on the event
id, call the Server API Modify event to modify the event information. -
Based on the event
id, call the Server API Query details about an event to obtain the event details. -
Based on the event
id, call the Server API Delete Event to delete the created event.
The following two deletion scenarios are supported:
- When the organizer deletes the event (the userId parameter in the path uses the organizer’s unionId), all attendees receive an event cancellation notification, and the event is removed from all attendees’ calendars.
- When an attendee deletes the event (the userId parameter in the path uses the attendee’s unionId), the event is removed only from that attendee’s own calendar, and other event attendees are not affected.