Outlook / Office365 API-通过扩展获取日历事件

时间:2018-11-20 02:52:36

标签: outlook office365

我正在使用Office365 API进行日历事件。我可以使用以下扩展程序(自定义数据)成功创建事件...

但是,当我收到日历事件时,它不会返回任何扩展数据字段。

GET https://outlook.office.com/api/v2.0/me/events

如何在事件数据中重新获得扩展?

POST: https://outlook.office.com/api/v2.0/me/events
authorization: bearer {token}
content-type: application/json
{ 
 "Subject": "Discuss the Calendar REST API",
  "Body": {
    "ContentType": "HTML",
    "Content": "I think it will meet our requirements!"
  },
  "Start": {
      "DateTime": "2016-09-06T18:00:00",
      "TimeZone": "Pacific Standard Time"
  },
  "End": {
      "DateTime": "2016-09-06T18:00:00",
      "TimeZone": "Pacific Standard Time"
  },

  "Extensions": [
    {
      "@odata.type": "Microsoft.OutlookServices.OpenTypeExtension",
      "ExtensionName": "Com.Contoso.Referral",
      "CompanyName": "Wingtip Toys",
      "ExpirationDate": "2015-12-30T11:00:00.000Z",
      "DealValue": 10000,
      "TopModels": [
        3001,
        4002,
        5003
      ],
      "TopSalespersons": [
        "Dana Swope",
        "Fanny Downs",
        "Randi Welch"
      ]
    }]

}

1 个答案:

答案 0 :(得分:0)

您可以使用以下api获得扩展名:

获取https://outlook.office.com/api/v2.0/me/events('{event_id}')/ extensions('{extensionId}')

例如:

获取https://outlook.office.com/api/v2.0/me/messages('AAMkAGE1M2IyNGNmLTI5MTktNDUyZi1iOTVl ===')/扩展名('Com.Contoso.Referral')

有关更多信息,请参考以下链接:

Get extension