Access CustomProperties set using office365 JS APIs from EWS or REST API

烂漫一生 提交于 2020-01-01 12:33:13

问题


I have an office 365 mail app that stores a value in a custom property before the item is saved. When the item is saved I want to access this property using a server-side application. Reading through the custom properties documentation tells me I can't access custom properties created using the JS API using any other service like EWS since these are not MAPI properties. Are there any workarounds ? Is it possible to access these using REST APIs ?


回答1:


Actually, it is documented where they are stored and in what format. The [MS-OXCEXT] specification provides the specifics. Basically the values are stored as a JSON dictionary in a custom property on the item. You should be able to use EWS to read that custom property as an ExtendedProperty.

UPDATE: After discussing with folks internally, I should disclaim that this isn't a supported method as MrPiao indicated. As stated, the storage design could change, which would break your app if you depend on the current design. The concern is that I don't want to lead you down a path that eventually becomes unworkable :). If you can describe what your end goal is, perhaps we can suggest a more durable solution.




回答2:


Custom Properties are definitely meant to be created and accessed only by Apps for Outlook APIs. However, this property has to get stored somewhere - and that's on the item. I'm fairly certain that if you made a GetItem call and enumerated every property on the item, you'll be able to access the custom props.

What's important to note is that this is most definitely an unsupported scenario. The design may change in the future, and this scenario may break. I would definitely not access custom properties outside a Mail App in a production setting.




回答3:


Guid PS_PUBLIC_STRINGS = new Guid("00020329-0000-0000-C000-000000000046"); ////PS_PUBLIC_STRINGS' GUID
ExtendedPropertyDefinition extendedPropertyDefinition = new ExtendedPropertyDefinition(PS_PUBLIC_STRINGS, "cecp-{your add-in manifest id}", MapiPropertyType.String);
PropertySet psPropSet = new PropertySet() { extendedPropertyDefinition };

message.Load(psPropSet);


来源:https://stackoverflow.com/questions/30187358/access-customproperties-set-using-office365-js-apis-from-ews-or-rest-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!