MS graph API-如何将生成的事件作为消息发送?

问题描述

我想进行在线会议活动并将消息发送到频道。

我进行了一次在线会议活动,并检查了所有邮件通知是否正常运行。 重要的是我想将事件作为消息发送到频道。

创建事件时,

var @event = new Event
            {
                
                Subject = subject,Body = new ItemBody
                {
                    ContentType = BodyType.Html,Content = subject
                },Start = new DateTimeTimeZone
                {
                    DateTime = "2020-09-22T14:30:00",TimeZone = "Korea Standard Time"
                },End = new DateTimeTimeZone
                {
                    DateTime = "2020-09-22T14:35:00",Organizer = new Recipient()
                {
                    EmailAddress = new EmailAddress
                    {
                        Address = groupInfo.Mail,Name = groupInfo.displayName
                    }
                },Attendees = new List<Attendee>()
                {
                    new Attendee
                    {
                        EmailAddress = new EmailAddress
                        {
                            Address = ownMail,Name = "name",},Type = AttendeeType.required,Status = new ResponseStatus
                        {
                            Response = ResponseType.Accepted
                        }
                    },new Attendee
                     {
                         EmailAddress = new EmailAddress
                         {
                             Address = groupInfo.Mail,Name = groupInfo.displayName
                         },Type = AttendeeType.required
                         
                     }
                },AllowNewTimeProposals = true,IsOnlineMeeting = true,OnlineMeetingProvider = OnlineMeetingProviderType.TeamsForBusiness,IsOrganizer = false,ResponseStatus = new ResponseStatus()
                {
                    Response = ResponseType.Organizer
                }

            };

            result2 = await graphClient.Groups[pGroupId].Events
                .Request()
                .Header("Prefer","outlook.timezone=\"Korea Standard Time\"")
                .AddAsync(@event);

现在,我将在线会议URL作为消息发送回频道。

像这样

 var chatMessage = new ChatMessage
            {
                Subject = result2.Subject,Body = new ItemBody
                {
                    ContentType = result2.Body.ContentType,Content = result2.Body.Content
                }
                
            };

            await graphClient.Teams[pGroupId].Channels[channel.Id].Messages
                .Request()
                .AddAsync(chatMessage);

            

我尝试过此文档,但我的活动没有附件。

请告诉我您是否有办法。 我整天都在看,但是我不知道。谢谢您的帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)