简体   繁体   中英

Outlook/Office365 API - Get Calendar events with Extensions

I am using the Office365 API for calendar events. I am able to create an event successfully with Extensions (custom data) like below...

But, when I get calendar events it does not return back any Extensions data field.

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

How do I get the Extensions back in the events data?

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"
      ]
    }]

}

You could get extension using the below api:

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

For example:

GET https://outlook.office.com/api/v2.0/me/messages ('AAMkAGE1M2IyNGNmLTI5MTktNDUyZi1iOTVl===')/extensions('Com.Contoso.Referral')

For more information, please refer to the below link:

Get extension

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM