outlook.com rest api不正确的组织者电子邮件 [英] outlook.com rest api incorrect organizer email

查看:99
本文介绍了outlook.com rest api不正确的组织者电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户在Outlook.com共享日历中创建事件时,REST API会告知日历所有者是组织者.

When a user has created an event in outlook.com shared calendar, the REST API tells that calendar owner is organizer.

我在Outlook.com中有一个日历,并且正在通过日历订阅将所有日历事件同步到我的服务器上.当发生某些事情时,我会收到通知,并且通知中包含可用于获取该新创建事件的对象的URL.

I have one calendar in Outlook.com and I'm syncing all calendar event's to my server with a calendar subscription. I get notifications when something happens and there is url in the notification which I can use to get object of that newly created event.

我现在在Outlook.com中有另一个用户,并且已经将日历共享给他.当他在该共享日历中执行某项操作时,我会收到通知,但不会获得有关谁创建了新活动的任何信息.

I have now another user in outlook.com and I have shared my calendar to him. When he does something in that shared calendar I get notifications, but I don't get any information about who created new event.

组织者始终是我的用户,出于某种原因,事件对象名称很好,但是电子邮件地址类似outlook-[nonsense]@outlook.com(不是我的电子邮件地址).我的真实电子邮件地址更像是lehtu@outlook.com.

Organizer is always my user and for some reason in the event object name is fine, but email address is something like outlook-[nonsense]@outlook.com (that's not my email address). My real email address is more like lehtu@outlook.com.

查看此图片以进行澄清:

See this image for clarification:

响应的组织者部分:

Organizer:
 { EmailAddress:
    { Name: 'Encode Testing',
      Address: 'outlook_2FD8F7EE77CEC8B8@outlook.com' } },

仅对我的用户(图片中的名称为Testing)进行应用程序身份验证.

Application auth is made only with my user(which name is Testing in the picture).

这是我的凭证:

this.scopes = [
    'openid',
    'offline_access',
    'https://outlook.office.com/calendars.readwrite'
];

重点是我的帐户下有更多日历,我将与其他人共享.但是我必须将创建事件的信息输入我的应用程序.

Point is to have more calendars under my account and I will share them to others. But I must get the info into my app that who is creating events.

有什么想法吗?

推荐答案

期望共享日历上事件的组织者始终是该日历的所有者.本质上,Testing2代表Testing创建了事件,但是Testing2并没有成为组织者.您在测试中看到的奇数电子邮件地址是其潜在的outlook.com电子邮件,由于您使用的是自定义域,因此该电子邮件地址已添加.

It is expected that the organizer of events on a shared calendar is always the owner of said calendar. Essentially Testing2 has created the event on Testing's behalf, but Testing2 does not become the organizer. The odd email address you are seeing for Testing is his underlying outlook.com email, which is added since you're using a custom domain.

不幸的是,今天看来,API似乎并没有直接公开有关实际创建事件的人的信息.建议在 UserVoice 上建议此功能.但是,您也许可以间接访问它.

Unfortunately today it doesn't seem like the API directly exposes information regarding who actually created an event. This is probably a good feature to suggest on UserVoice. However, you might be able to access it indirectly.

只要API不直接公开属性,就可以查看Exchange服务器公开的基础属性.我通常会在 MS-OXPROPS 文档.我发现 PidTagCreatorName ,看起来像它可能有助于获取您想要的数据.

Whenever the API doesn't directly expose a property, you can look at the underlying properties exposed by Exchange server. I usually look them up in the MS-OXPROPS doc. I found PidTagCreatorName, which looks like it might help get the data you're after.

通常,您可以通过展开(通过$expand)项目上的SingleValueExtendedProperties集合来访问这些基础属性.因此,如果您对以下内容执行GET:

You can usually access these underlying properties by expanding (via $expand) the SingleValueExtendedProperties collection on items. So if you do a GET on the following:

https://outlook.office.com/api/v2.0/me/events?
$expand=SingleValueExtendedProperties($filter=PropertyId eq 'String 0x3FF8')

您会看到返回的结果类似于:

You'll see results returned that look something like:

{
    ...
    All the normal props you usually see
    ...
    "SingleValueExtendedProperties": [
        {
            "PropertyId": "String 0x3ff8",
            "Value": "Jason Johnston"
        }
    ]
}

这篇关于outlook.com rest api不正确的组织者电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆