Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/calendar/users/{userId}/calendars/{calendarId}/events/{eventId} |
| HTTP Method | GET |
| Supported app types | appType-Internal app appType-Third-party enterprise app appType-Third-party personal app |
| Required permissions | permission-Calendar.Event.Read-Read permission for events in the Calendar app |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling this API. Obtain it as follows: - For internal apps, call the Obtain the access token of an internal app API. - For third-party enterprise apps, call the Obtain the access token of an enterprise authorized to a third-party app API. - For third-party personal apps, call the Obtain a user token API. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| userId | String | Yes | The unionId of the user the event belongs to. - For internal apps and third-party enterprise apps, call the Query user details API to obtain the unionid value. - For third-party personal apps, call the Obtain user profile from Contacts API to obtain the unionId value. |
| calendarId | String | Yes | The ID of the calendar the event belongs to. Set to primary to indicate the user’s primary calendar. |
| eventId | String | Yes | The event ID. Call the Query an event list API to obtain the id value. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| maxAttendees | Long | No | The maximum number of attendees. Default: 100. Maximum: 500. |
Request example
HTTPGET /v1.0/calendar/users/iiiP35sJaxxxxRKgiEiF/calendars/primary/events/cnNTbW1YbUxxxxvdlQrQT09?maxAttendees=100 HTTP/1.1
Host:api.dingtalk.io
x-acs-dingtalk-access-token:dd43888xxx
Content-Type:application/json
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sample;
import com.aliyun.tea.*;
public class Sample {
/**
* Initialize the account Client using a Token
* @return Client
* @throws Exception
*/
public static com.aliyun.dingtalkcalendar_1_0.Client createClient() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https";
config.regionId = "central";
return new com.aliyun.dingtalkcalendar_1_0.Client(config);
}
public static void main(String[] args_) throws Exception {
java.util.List<String> args = java.util.Arrays.asList(args_);
com.aliyun.dingtalkcalendar_1_0.Client client = Sample.createClient();
com.aliyun.dingtalkcalendar_1_0.models.GetEventHeaders getEventHeaders = new com.aliyun.dingtalkcalendar_1_0.models.GetEventHeaders();
getEventHeaders.xAcsDingtalkAccessToken = "<your access token>";
com.aliyun.dingtalkcalendar_1_0.models.GetEventRequest getEventRequest = new com.aliyun.dingtalkcalendar_1_0.models.GetEventRequest()
.setMaxAttendees(100L);
try {
client.getEventWithOptions("iiiP35sJaxxxxRKgiEiF", "primary", "cnNTbW1YbUxxxxvdlQrQT09", getEventRequest, getEventHeaders, new com.aliyun.teautil.models.RuntimeOptions());
} catch (TeaException err) {
if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
// err contains code and message properties to help locate the issue
}
} 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 contains code and message properties to help locate the issue
}
}
}
}
# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
import sys
from typing import List
from alibabacloud_dingtalk.calendar_1_0.client import Client as dingtalkcalendar_1_0Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_dingtalk.calendar_1_0 import models as dingtalkcalendar__1__0_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient
class Sample:
def __init__(self):
pass
@staticmethod
def create_client() -> dingtalkcalendar_1_0Client:
"""
Initialize the account Client using a Token
@return: Client
@throws Exception
"""
config = open_api_models.Config()
config.protocol = 'https'
config.region_id = 'central'
return dingtalkcalendar_1_0Client(config)
@staticmethod
def main(
args: List[str],
) -> None:
client = Sample.create_client()
get_event_headers = dingtalkcalendar__1__0_models.GetEventHeaders()
get_event_headers.x_acs_dingtalk_access_token = '<your access token>'
get_event_request = dingtalkcalendar__1__0_models.GetEventRequest(
max_attendees=100
)
try:
client.get_event_with_options('iiiP35sJaxxxxRKgiEiF', 'primary', 'cnNTbW1YbUxxxxvdlQrQT09', get_event_request, get_event_headers, util_models.RuntimeOptions())
except Exception as err:
if not UtilClient.empty(err.code) and not UtilClient.empty(err.message):
# err contains code and message properties to help locate the issue
pass
@staticmethod
async def main_async(
args: List[str],
) -> None:
client = Sample.create_client()
get_event_headers = dingtalkcalendar__1__0_models.GetEventHeaders()
get_event_headers.x_acs_dingtalk_access_token = '<your access token>'
get_event_request = dingtalkcalendar__1__0_models.GetEventRequest(
max_attendees=100
)
try:
await client.get_event_with_options_async('iiiP35sJaxxxxRKgiEiF', 'primary', 'cnNTbW1YbUxxxxvdlQrQT09', get_event_request, get_event_headers, util_models.RuntimeOptions())
except Exception as err:
if not UtilClient.empty(err.code) and not UtilClient.empty(err.message):
# err contains code and message properties to help locate the issue
pass
if __name__ == '__main__':
Sample.main(sys.argv[1:])
<?php
// This file is auto-generated, don't edit it. Thanks.
namespace AlibabaCloud\SDK\Sample;
use AlibabaCloud\SDK\Dingtalk\Vcalendar_1_0\Dingtalk;
use \Exception;
use AlibabaCloud\Tea\Exception\TeaError;
use AlibabaCloud\Tea\Utils\Utils;
use Darabonba\OpenApi\Models\Config;
use AlibabaCloud\SDK\Dingtalk\Vcalendar_1_0\Models\GetEventHeaders;
use AlibabaCloud\SDK\Dingtalk\Vcalendar_1_0\Models\GetEventRequest;
use AlibabaCloud\Tea\Utils\Utils\RuntimeOptions;
class Sample {
/**
* Initialize the account Client using a Token
* @return Dingtalk Client
*/
public static function createClient(){
$config = new Config([]);
$config->protocol = "https";
$config->regionId = "central";
return new Dingtalk($config);
}
/**
* @param string[] $args
* @return void
*/
public static function main($args){
$client = self::createClient();
$getEventHeaders = new GetEventHeaders([]);
$getEventHeaders->xAcsDingtalkAccessToken = "<your access token>";
$getEventRequest = new GetEventRequest([
"maxAttendees" => 100
]);
try {
$client->getEventWithOptions("iiiP35sJaxxxxRKgiEiF", "primary", "cnNTbW1YbUxxxxvdlQrQT09", $getEventRequest, $getEventHeaders, new RuntimeOptions([]));
}
catch (Exception $err) {
if (!($err instanceof TeaError)) {
$err = new TeaError([], $err->getMessage(), $err->getCode(), $err);
}
if (!Utils::empty_($err->code) && !Utils::empty_($err->message)) {
// err contains code and message properties to help locate the issue
}
}
}
}
$path = __DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
if (file_exists($path)) {
require_once $path;
}
Sample::main(array_slice($argv, 1));
// This file is auto-generated, don't edit it. Thanks.
package main
import (
"os"
util "github.com/alibabacloud-go/tea-utils/v2/service"
dingtalkcalendar_1_0 "github.com/alibabacloud-go/dingtalk/calendar_1_0"
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
"github.com/alibabacloud-go/tea/tea"
)
/**
* Initialize the account Client using a Token
* @return Client
* @throws Exception
*/
func CreateClient () (_result *dingtalkcalendar_1_0.Client, _err error) {
config := &openapi.Config{}
config.Protocol = tea.String("https")
config.RegionId = tea.String("central")
_result = &dingtalkcalendar_1_0.Client{}
_result, _err = dingtalkcalendar_1_0.NewClient(config)
return _result, _err
}
func _main (args []*string) (_err error) {
client, _err := CreateClient()
if _err != nil {
return _err
}
getEventHeaders := &dingtalkcalendar_1_0.GetEventHeaders{}
getEventHeaders.XAcsDingtalkAccessToken = tea.String("<your access token>")
getEventRequest := &dingtalkcalendar_1_0.GetEventRequest{
MaxAttendees: tea.Int64(100),
}
tryErr := func()(_e error) {
defer func() {
if r := tea.Recover(recover()); r != nil {
_e = r
}
}()
_, _err = client.GetEventWithOptions(tea.String("iiiP35sJaxxxxRKgiEiF"), tea.String("primary"), tea.String("cnNTbW1YbUxxxxvdlQrQT09"), getEventRequest, getEventHeaders, &util.RuntimeOptions{})
if _err != nil {
return _err
}
return nil
}()
if tryErr != nil {
var err = &tea.SDKError{}
if _t, ok := tryErr.(*tea.SDKError); ok {
err = _t
} else {
err.Message = tea.String(tryErr.Error())
}
if !tea.BoolValue(util.Empty(err.Code)) && !tea.BoolValue(util.Empty(err.Message)) {
// err contains code and message properties to help locate the issue
}
}
return _err
}
func main() {
err := _main(tea.StringSlice(os.Args[1:]))
if err != nil {
panic(err)
}
}
// This file is auto-generated, don't edit it
import Util, * as $Util from '@alicloud/tea-util';
import dingtalkcalendar_1_0, * as $dingtalkcalendar_1_0 from '@alicloud/dingtalk/calendar_1_0';
import OpenApi, * as $OpenApi from '@alicloud/openapi-client';
import * as $tea from '@alicloud/tea-typescript';
export default class Client {
/**
* Initialize the account Client using a Token
* @return Client
* @throws Exception
*/
static createClient(): dingtalkcalendar_1_0 {
let config = new $OpenApi.Config({ });
config.protocol = "https";
config.regionId = "central";
return new dingtalkcalendar_1_0(config);
}
static async main(args: string[]): Promise<void> {
let client = Client.createClient();
let getEventHeaders = new $dingtalkcalendar_1_0.GetEventHeaders({ });
getEventHeaders.xAcsDingtalkAccessToken = "<your access token>";
let getEventRequest = new $dingtalkcalendar_1_0.GetEventRequest({
maxAttendees: 100,
});
try {
await client.getEventWithOptions("iiiP35sJaxxxxRKgiEiF", "primary", "cnNTbW1YbUxxxxvdlQrQT09", getEventRequest, getEventHeaders, new $Util.RuntimeOptions({ }));
} catch (err) {
if (!Util.empty(err.code) && !Util.empty(err.message)) {
// err contains code and message properties to help locate the issue
}
}
}
}
Client.main(process.argv.slice(2));
// This file is auto-generated, don't edit it. Thanks.
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Tea;
using Tea.Utils;
namespace AlibabaCloud.SDK.Sample
{
public class Sample
{
/**
* Initialize the account Client using a Token
* @return Client
* @throws Exception
*/
public static AlibabaCloud.SDK.Dingtalkcalendar_1_0.Client CreateClient()
{
AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config();
config.Protocol = "https";
config.RegionId = "central";
return new AlibabaCloud.SDK.Dingtalkcalendar_1_0.Client(config);
}
public static void Main(string[] args)
{
AlibabaCloud.SDK.Dingtalkcalendar_1_0.Client client = CreateClient();
AlibabaCloud.SDK.Dingtalkcalendar_1_0.Models.GetEventHeaders getEventHeaders = new AlibabaCloud.SDK.Dingtalkcalendar_1_0.Models.GetEventHeaders();
getEventHeaders.XAcsDingtalkAccessToken = "<your access token>";
AlibabaCloud.SDK.Dingtalkcalendar_1_0.Models.GetEventRequest getEventRequest = new AlibabaCloud.SDK.Dingtalkcalendar_1_0.Models.GetEventRequest
{
MaxAttendees = 100,
};
try
{
client.GetEventWithOptions("iiiP35sJaxxxxRKgiEiF", "primary", "cnNTbW1YbUxxxxvdlQrQT09", getEventRequest, getEventHeaders, new AlibabaCloud.TeaUtil.Models.RuntimeOptions());
}
catch (TeaException err)
{
if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message))
{
// err contains code and message properties to help locate the issue
}
}
catch (Exception _err)
{
TeaException err = new TeaException(new Dictionary<string, object>
{
{ "message", _err.Message }
});
if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message))
{
// err contains code and message properties to help locate the issue
}
}
}
}
}
# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from __future__ import unicode_literals
import sys
from alibabacloud_dingtalkcalendar_1_0.client import Client as dingtalkcalendar_1_0Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_dingtalkcalendar_1_0 import models as dingtalkcalendar__1__0_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient
class Sample(object):
def __init__(self):
pass
@staticmethod
def create_client():
"""
Initialize the account Client using a Token
@return: Client
@throws Exception
"""
config = open_api_models.Config()
config.protocol = 'https'
config.region_id = 'central'
return dingtalkcalendar_1_0Client(config)
@staticmethod
def main(args):
client = Sample.create_client()
get_event_headers = dingtalkcalendar__1__0_models.GetEventHeaders()
get_event_headers.x_acs_dingtalk_access_token = '<your access token>'
get_event_request = dingtalkcalendar__1__0_models.GetEventRequest(
max_attendees=100
)
try:
client.get_event_with_options('iiiP35sJaxxxxRKgiEiF', 'primary', 'cnNTbW1YbUxxxxvdlQrQT09', get_event_request, get_event_headers, util_models.RuntimeOptions())
except Exception as err:
if not UtilClient.empty(err.code) and not UtilClient.empty(err.message):
# err contains code and message properties to help locate the issue
pass
if __name__ == '__main__':
Sample.main(sys.argv[1:])
#!/usr/bin/env xcrun swift
import Cocoa
import Foundation
import Tea
import TeaUtils
import AlibabacloudDingtalkcalendar10
import AlibabacloudOpenApi
open class Client {
public static func createClient() throws -> AlibabacloudDingtalkcalendar10.Client {
var config: AlibabacloudOpenApi.Config = AlibabacloudOpenApi.Config([:])
config.protocol_ = "https"
config.regionId = "central"
return AlibabacloudDingtalkcalendar10.Client(config)
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public static func main(_ args: [String]?) async throws -> Void {
var client: AlibabacloudDingtalkcalendar10.Client = try Client.createClient()
var getEventHeaders: AlibabacloudDingtalkcalendar10.GetEventHeaders = AlibabacloudDingtalkcalendar10.GetEventHeaders([:])
getEventHeaders.xAcsDingtalkAccessToken = "<your access token>"
var getEventRequest: AlibabacloudDingtalkcalendar10.GetEventRequest = AlibabacloudDingtalkcalendar10.GetEventRequest([
"maxAttendees": 100
])
do {
try await client.getEventWithOptions("iiiP35sJaxxxxRKgiEiF", "primary", "cnNTbW1YbUxxxxvdlQrQT09", getEventRequest as! AlibabacloudDingtalkcalendar10.GetEventRequest, getEventHeaders as! AlibabacloudDingtalkcalendar10.GetEventHeaders, TeaUtils.RuntimeOptions([:]))
}
catch {
if error is Tea.TeaError {
var err = error as! Tea.TeaError
if (!TeaUtils.Client.empty(err.code) && !TeaUtils.Client.empty(err.message)) {
}
} else {
throw error
}
}
}
}
Client.main(CommandLine.arguments)
Response
Response body
| Name | Type | Description |
|---|---|---|
| id | String | The event ID. |
| summary | String | The event title. |
| description | String | The event description. |
| status | String | The event status. - confirmed: Normal - cancelled: Canceled |
| start | Object | The event start time. |
| date | String | The event start date in yyyy-MM-dd format. - Required for all-day events - Must be empty for non-all-day events |
| dateTime | String | The event start time in ISO-8601 date-time format. - Must be empty for all-day events - Required for non-all-day events |
| timeZone | String | The time zone of the event start time, in TZ database name format. - Must be empty for all-day events - Required for non-all-day events |
| originStart | Object | The originally created start time in a recurrence series. Not returned for regular single events. |
| dateTime | String | The date and time information, expressed in ISO 8601 format and always in UTC. For example: Midnight UTC on January 1, 2023 is 2023-01-01T00:00:00Z. |
| end | Object | The event end time. |
| date | String | The event end date in yyyy-MM-dd format. - Required for all-day events - Must be empty for non-all-day events |
| dateTime | String | The event end time in ISO-8601 date-time format. - Must be empty for all-day events - Required for non-all-day events |
| timeZone | String | The time zone of the event end time. Must be the same as the time zone of the start time, in TZ database name format. - Must be empty for all-day events - Required for non-all-day events |
| isAllDay | Boolean | Whether the event is an all-day event. - true: Yes - false: No |
| recurrence | Object | The event recurrence rule. |
| pattern | Object | The recurrence pattern. |
| type | String | The recurrence rule type. - daily: Repeats every interval days - weekly: Repeats every interval weeks on daysOfWeek - absoluteMonthly: Repeats on dayOfMonth every interval months - relativeMonthly: Repeats on daysOfWeek of the index week every interval months - absoluteYearly: Repeats every interval years |
| dayOfMonth | Integer | When type=absoluteMonthly, specifies the day of the month. |
| daysOfWeek | String | The day of the week, specified in lowercase English. Use commas to separate multiple values. |
| index | String | When type=relativeMonthly, specifies which week of the month. - first - second - third - fourth - last last indicates the last week of the month. |
| interval | Integer | The recurrence interval. The unit varies by type. For example, when type=daily, it indicates an interval of N days; when type=absoluteYearly, it indicates an interval of N years. |
| firstDayOfWeek | String | The first day of the week. Valid values: sunday, monday, tuesday, wednesday, thursday, friday, saturday. Default: sunday. |
| range | Object | The recurrence range. |
| type | String | The recurrence range type. - noEnd: Never ends - endDate: Recurs until a specified date - numbered: Recurs a specified number of times |
| endDate | String | The recurrence end time. |
| numberOfOccurrences | Integer | The number of recurrences. |
| attendees | Array | The list of attendees. |
| id | String | The user’s unionId. |
| displayName | String | The user name. |
| responseStatus | String | The reply status. |
| self | Boolean | Whether this is the currently signed-in user. - true: Yes - false: No |
| isOptional | Boolean | Whether this is an optional attendee. - true: Yes - false: No |
| organizer | Object | The organizer. |
| id | String | The organizer’s unionId. |
| displayName | String | The user name. |
| responseStatus | String | The reply status. |
| self | Boolean | Whether this is the currently signed-in user. - true: Yes - false: No |
| location | Object | Information about the event location. |
| displayName | String | The event location name. |
| seriesMasterId | String | The master event ID of a recurring event. Empty for non-recurring events. |
| createTime | String | The created time. |
| updateTime | String | The update time. |
| reminders | Array | The event reminders. |
| method | String | The reminder method. |
| minutes | String | Send a reminder N minutes before the event starts. |
| onlineMeetingInfo | Object | The online meeting. |
| type | String | The online meeting type. Currently supported: - dingtalk: DingTalk Video Meeting |
| conferenceId | String | The meeting ID. |
| url | String | The URL to join the meeting. |
| extraInfo | Map | Additional extended information. |
| extendedProperties | Object | The event extended attributes. |
| sharedProperties | Object | The shared attributes. |
| sourceOpenCid | String | When the event is initiated from a group, this field indicates the source group of the event. |
| belongCorpId | String | The organization ID (corpId) that the event belongs to. |
| meetingRooms | Array | The meeting rooms. |
| roomId | String | The roomId of the meeting room. |
| responseStatus | String | The response status of the meeting room. - accepted: Accepted - tentative: Under approval - declined: Approval rejected |
| displayName | String | The meeting room name. |
| categories | Array | The event categories. |
| displayName | String | The event category name. |
| richTextDescription | Object | The Rich Text description. |
| text | String | The Rich Text description content. |
Response body example
HTTP/1.1 200 OK
Content-Type:application/json
{
"id" : "iiiP35sJxxxxPRKgiEiF",
"summary" : "test event",
"description" : "something about this event",
"status" : "confirmed",
"start" : {
"date" : "2020-01-01",
"dateTime" : "2020-01-01T10:15:30+08:00",
"timeZone" : "Asia/Shanghai"
},
"originStart" : {
"dateTime" : "2023-01-01T00:00:00Z"
},
"end" : {
"date" : "2020-01-01",
"dateTime" : "2020-01-01T10:15:30+08:00",
"timeZone" : "Asia/Shanghai"
},
"isAllDay" : false,
"recurrence" : {
"pattern" : {
"type" : "daily",
"dayOfMonth" : 14,
"daysOfWeek" : "monday",
"index" : "first",
"interval" : 1
},
"range" : {
"type" : "noEnd",
"endDate" : "2020-01-01T10:15:30+08:00",
"numberOfOccurrences" : 5
}
},
"attendees" : [ {
"id" : "iiiP35sJxxxxPRKgiEiF",
"displayName" : "jack",
"responseStatus" : "accepted",
"self" : false,
"isOptional" : false
} ],
"organizer" : {
"id" : "iiiP35sJxxxxPRKgiEiF",
"displayName" : "tony",
"responseStatus" : "accepted",
"self" : false
},
"location" : {
"displayName" : "room 1-2-3",
"meetingRooms" : [ "Meeting Room" ]
},
"seriesMasterId" : "cnNTbW1YbxxxxvdlQrQT09",
"createTime" : "2020-01-01T10:15:30+08:00",
"updateTime" : "2020-01-01T10:15:30+08:00",
"reminders" : [ {
"method" : "dingtalk",
"minutes" : "15"
} ],
"onlineMeetingInfo" : {
"type" : "dingtalk",
"conferenceId" : "5c4df21d-xxxx-a6db402b9f3a",
"url" : "dingtalk://dingtalkclient/page/videoxxxxalendar?confId=5c4df21d-xxxx9f3f&calendarId=127xxxx124"
},
"extendedProperties" : {
"sharedProperties" : {
"sourceOpenCid" : "zxcvasdfvb123====",
"belongCorpId" : "dingd*****1231231"
}
},
"meetingRooms" : [ {
"roomId" : "c10315a8b4e740a317813ab6fxxxxxx",
"responseStatus" : "accepted",
"displayName" : "Meeting Room 1"
} ],
"categories" : [ {
"displayName" : "Weekly Meeting"
} ]
}
Error codes
If the API call returns an error, look up the solution in the Global error codes document based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | invalidParameter | forwardErrorMessage | Invalid parameter |
| 404 | instanceNotExist | instance not exist | The recurring event instance does not exist |
| 404 | itemNotFound | forwardErrorMessage | The specified event cannot be found |