检索事件详细信息时,无法扩展singleValueExtendedProperty [英] Expanding singleValueExtendedProperty not working when retrieving Event details

查看:117
本文介绍了检索事件详细信息时,无法扩展singleValueExtendedProperty的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Microsoft Graph检索事件的自定义属性值. 自定义属性是由Outlook Office.js加载项创建的

I am trying to retrieve custom property value for an event using Microsoft Graph. The custom property was created by an Outlook Office.js Add-ing

这是请求

/v1.0/me/events/{id}?$expand=singleValueExtendedProperties($filter=id eq 'String {00020329-0000-0000-C000-000000000046} Name myCusProp')

这将返回来自Graph的成功响应,但不会返回singleValueExtendedProperty.但是,Outlook加载项仍然能够从同一事件中检索属性值.

This returns a successful response from Graph but it does not return the singleValueExtendedProperty. The Outlook add-in, however, is still able to retrieve the property value from the same Event.

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('{id}')/events/$entity",
  "@odata.etag": "W/\"SdXmMkSN8kCNtzTsQ4x1lwAD7sMWVg==\"",
  "id": "{id}",
  "createdDateTime": "2019-09-30T10:12:34.110571Z",
  "lastModifiedDateTime": "2019-09-30T10:23:57.8338159Z",
  "changeKey": "SdXmMkSN8kCNtzTsQ4x1lwAD7sMWVg==",
  "categories": [],
  "originalStartTimeZone": "blah blah",
  "originalEndTimeZone": "blah blah Standard Time",
  "iCalUId": "040000008...EBBE4999DC5A61D31AC544",
  "reminderMinutesBeforeStart": 15,
  "isReminderOn": true,
  "hasAttachments": false,
  "subject": "WWW-002",
  "bodyPreview": "rt",
  "importance": "normal",
  "sensitivity": "normal",
  "isAllDay": false,
  "isCancelled": false,
  "isOrganizer": true,
  "responseRequested": true,
  "seriesMasterId": null,
  "showAs": "busy",
  "type": "singleInstance",
  "webLink": "https://outlook.office365.com/owa/?itemid=AQMkADU2OWFjYTFjLWNkMGYtNDdlNS1hNDIxLWIxYjlmY...DqyJu%2FWyzJk6m5v0MbSs7lwcASdXmMkSN8kCNtzTsQ4x1lwAAAgENA...AD7q52owAAAA%3D%3D&exvsurl=1&path=/calendar/item",
  "onlineMeetingUrl": null,
  "recurrence": null,
  "responseStatus": {
    "response": "organizer",
    "time": "0001-01-01T00:00:00Z"
  },
  "body": {
    "contentType": "html",
    "content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n</head>\r\n<body>\r\n<div>rt</div>\r\n</body>\r\n</html>\r\n"
  },
  "start": {
    "dateTime": "2019-09-19T02:30:00.0000000",
    "timeZone": "UTC"
  },
  "end": {
    "dateTime": "2019-09-19T03:00:00.0000000",
    "timeZone": "UTC"
  },
  "location": {
    "displayName": "",
    "locationType": "default",
    "uniqueIdType": "unknown",
    "address": {},
    "coordinates": {}
  },
  "locations": [],
  "attendees": [],
  "organizer": {
    "emailAddress": {
      "name": "Info a",
      "address": "name@domain.com"
    }
  }
}

----更新1-office.js代码-----

----Update 1 - office.js code-----

这是上面的office-js/outlook-add-in代码参考. 可以在此处读取自定义属性值,而不会出现任何问题.

This is office-js/outlook-add-in code reference above. The custom property value can be read here without an issue.

const item = Office.context.mailbox.item;

item.loadCustomPropertiesAsync(asyncResult => {
    if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {
        let customProps = asyncResult.value;
        customProps.set("myCusProp", "google.com");
        customProps.saveAsync(asyncResult => {
            if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {
                item.loadCustomPropertiesAsync(asyncResult => {
                    const customProps = asyncResult.value;
                    const myCusProp = customProps.get("myCusProp");
                })
            }
        });
    }
}); 

推荐答案

来自代替myCusProp使用cecp-/* add-in id from manifest */

加载项ID是清单中的GUID,此响应具有自定义属性,如JSON.

Add-in id is the guid from manifest, this response has a custom properties as JSON.

这篇关于检索事件详细信息时,无法扩展singleValueExtendedProperty的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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