Reputation: 634
Good Day,
For the sake of only adding verbose information if needed, I will describe the problem I am having, then provide examples if required for finding the answer.
In Outlook, I can create an appointment which seems to just to be a meeting where I am the organizer and the only attendee with no invites sent.
When I create a calendar entry in Outlook as an appointment (no invites), and then edit it in outlook, the "To:" field is not displayed, and I can click on Invite Attendees.
In Outlook, I can also create a new meeting, which seems to be the same as a appointment, but with attendees other then myself that get sent invites as part of the process.
On this page: https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations it states that "Event operations An event represents an appointment or meeting on the user's calendar. An event can be a series master (for recurring events), an occurrence, a single instance, or an exception."
If I create both a meeting and an appointment in my outlook client, then request them with the API and compare the properties of the event, I can not find a functional difference between them. They both have me as organizer, and me as an attendee, they both seem to have the same event types, and other properties.
If I create a new event with the API, and try to leave "Attendees" null, it will fail to create with "bad request". if I put myself as both organizer and attendee (or just Attendee), it creates the event, but shows up as a meeting in my outlook with "no responses".
I can not figure out the combination of settings to use the API to create an event that appears as an appointment in outlook instead of a meeting.
Is there a property or setting I need to be sending in a certain way when using the rest api to create an event without any attendees/invites?
Thanks!
Steve
Answer:
Thanks to Jeffrey Chen I was able to find the problem in the post data I was sending.
I had created a DTO for a CalendarEvent with a property for "Attendees" as a List, but I did not initialize this list.
If I serialized to JSON with no Attendees, this property became null instead of an empty array [].
Turns out the attendees property can be left out entirely, but if it is included it must either be an empty array or contain actual attendees, null causes bad request.
Thanks!
Upvotes: 2
Views: 2351
Reputation: 4690
I can not figure out the combination of settings to use the API to create an event that appears as an appointment in outlook instead of a meeting.
If I understand correctly, you want to create a appointment through Outlook REST API. If so, you can post a request as following:
{
"Subject": "Create from Office 365 API",
"Start": {
"DateTime": "2016-03-24T15:00:00",
"TimeZone": "China Standard Time"
},
"End": {
"DateTime": "2016-03-24T16:00:00",
"TimeZone": "China Standard Time"
}
}
Upvotes: 2