Skip to content

Instantly share code, notes, and snippets.

@ThatJoeMoore
Created October 26, 2017 16:44
Show Gist options
  • Save ThatJoeMoore/2e1e71c7ae2f530fd48404b340e16608 to your computer and use it in GitHub Desktop.
Save ThatJoeMoore/2e1e71c7ae2f530fd48404b340e16608 to your computer and use it in GitHub Desktop.
Exchange API definition
---
swagger: "2.0"
info:
description: "Fronts Office 365/Exchange Online events APIs to add BYU OAuth support\
\ and a read-through cache."
version: "1.0.0"
title: "exchange-events-shim"
contact: {}
license:
name: "Apache 2.0"
url: "https://www.apache.org/licenses/LICENSE-2.0"
host: "api.byu.edu"
basePath: "/domains/exchange/events-middleware/v1"
schemes:
- "https"
consumes:
- "application/json"
produces:
- "application/json"
security:
- BYU OAuth 2: []
paths:
/events:
get:
tags:
- "Query"
summary: "Query Events"
parameters:
- name: "email"
in: "query"
required: false
type: "string"
- name: "page_size"
in: "query"
required: false
type: "integer"
format: "int32"
description: "The maximum number of results to return. If page_start and page_end\
\ are both specified, this value is ignored."
default: 100
minimum: 1
maximum: 1000
- name: "page_start"
in: "query"
required: false
type: "integer"
format: "int32"
description: "Zero-based index of the first row to return"
default: 0
minimum: 0
- name: "page_end"
in: "query"
required: false
type: "integer"
format: "int32"
description: "Zero-based index of the last row to return. If page_size and\
\ page_start are both specified, this value will take precedence over page_size."
minimum: 1
responses:
200:
description: "Status 200"
schema:
$ref: "#/definitions/EventList"
post:
summary: "Create Event"
consumes: []
parameters:
- name: "body"
in: "body"
required: true
schema:
$ref: "#/definitions/CreateEvent"
responses:
200:
description: "Status 200"
schema:
$ref: "#/definitions/Event"
/events/{eventId}:
get:
summary: "Get Single Event"
parameters: []
responses:
200:
description: "Status 200"
schema:
$ref: "#/definitions/Event"
put:
summary: "Update Single Event"
consumes: []
parameters:
- name: "body"
in: "body"
required: true
schema:
type: "object"
responses:
200:
description: "Status 200"
delete:
summary: "Delete Single Event"
parameters: []
responses:
204:
description: "Successfully deleted"
parameters:
- name: "eventId"
in: "path"
required: true
type: "string"
/batch/events:
post:
summary: "Create Multiple Events"
consumes: []
parameters:
- name: "body"
in: "body"
required: true
schema:
$ref: "#/definitions/BatchCreateEvents"
responses:
200:
description: "Status 200"
schema:
$ref: "#/definitions/BatchResponse"
put:
summary: "Update Multiple Events"
consumes: []
parameters:
- name: "body"
in: "body"
required: true
schema:
$ref: "#/definitions/BatchUpdateEvents"
responses:
200:
description: "Status 200"
schema:
$ref: "#/definitions/BatchResponse"
securityDefinitions:
BYU OAuth 2:
type: "oauth2"
tokenUrl: "https://api.byu.edu/token"
flow: "application"
scopes: {}
definitions:
CreateEvent:
type: "object"
required:
- "attendees"
- "body"
- "end_date_time"
- "organizer"
- "response_requested"
- "start_date_time"
properties:
start_date_time:
type: "string"
format: "date-time"
description: "Date/Time at which the event starts"
example: "2016-02-28T16:41:41.090Z"
end_date_time:
type: "string"
format: "date-time"
description: "Date/Time at which the event ends"
example: "2016-02-28T16:41:41.090Z"
body:
$ref: "#/definitions/EventBody"
attendees:
type: "array"
items:
$ref: "#/definitions/InvitedAttendee"
importance:
$ref: "#/definitions/EventImportance"
organizer:
$ref: "#/definitions/EventRecipient"
response_requested:
type: "boolean"
sensitivity:
$ref: "#/definitions/EventSensitivity"
recurring_series_id:
type: "string"
description: "ID of the parent event series, if the event is one in a recurring\
\ sequence."
show_as:
$ref: "#/definitions/EventFreeBusy"
event_type:
$ref: "#/definitions/EventType"
is_all_day:
type: "boolean"
default: false
reminder_minutes_before_start:
type: "integer"
format: "int32"
minimum: 0
Event:
type: "object"
required:
- "attendees"
- "body"
- "created_date_time"
- "current_user_is_organizer"
- "end_date_time"
- "event_type"
- "id"
- "is_all_day"
- "is_cancelled"
- "is_reminder_on"
- "links"
- "metadata"
- "organizer"
- "response_requested"
- "sensitivity"
- "shared_id"
- "show_as"
- "start_date_time"
- "version"
properties:
metadata:
required:
- "validation_result"
type: "object"
description: "Object Metadata"
properties:
validation_result:
required:
- "code"
- "message"
type: "object"
properties:
code:
type: "integer"
format: "int8"
description: "Always \"200\""
message:
type: "string"
description: "Always \"Success\""
id:
type: "string"
description: "Event ID"
shared_id:
type: "string"
description: "Unique ID that is the same across all calendars, as opposed\
\ to \"id\", which is unique to the calendar."
start_date_time:
type: "string"
format: "date-time"
description: "Date/Time at which the event starts"
example: "2016-02-28T16:41:41.090Z"
end_date_time:
type: "string"
format: "date-time"
description: "Date/Time at which the event ends"
example: "2016-02-28T16:41:41.090Z"
body:
$ref: "#/definitions/EventBody"
attendees:
type: "array"
items:
$ref: "#/definitions/EventAttendee"
version:
type: "string"
description: "Modification version ID. Any time this event changes, this ID\
\ will change."
created_date_time:
type: "string"
format: "date-time"
description: "Date/Time the event was created"
last_modified_date_time:
type: "string"
format: "date-time"
importance:
$ref: "#/definitions/EventImportance"
organizer:
$ref: "#/definitions/EventRecipient"
current_user_is_organizer:
type: "boolean"
response_requested:
type: "boolean"
sensitivity:
$ref: "#/definitions/EventSensitivity"
recurring_series_id:
type: "string"
description: "ID of the parent event series, if the event is one in a recurring\
\ sequence."
show_as:
$ref: "#/definitions/EventFreeBusy"
event_type:
$ref: "#/definitions/EventType"
recurrence:
$ref: "#/definitions/Recurrence"
is_all_day:
type: "boolean"
is_cancelled:
type: "boolean"
is_reminder_on:
type: "boolean"
reminder_minutes_before_start:
type: "integer"
format: "int32"
minimum: 0
links:
required:
- "event__delete"
- "event__self"
- "event__update"
- "events__list"
type: "object"
description: "HATEOAS Links"
properties:
event__self:
required:
- "href"
- "method"
- "rel"
type: "object"
properties:
rel:
type: "string"
description: "Always \"self\""
href:
type: "string"
description: "Link URI"
method:
type: "string"
description: "Always \"GET\""
event__update:
required:
- "href"
- "method"
- "rel"
type: "object"
properties:
rel:
type: "string"
description: "Always \"event__update\""
href:
type: "string"
description: "Link URI"
method:
type: "string"
description: "Always \"GET\""
event__delete:
required:
- "href"
- "method"
- "rel"
type: "object"
properties:
rel:
type: "string"
description: "Always \"event__delete\""
href:
type: "string"
description: "Link URI"
method:
type: "string"
description: "Always \"DELETE\""
events__list:
required:
- "href"
- "method"
- "rel"
type: "object"
properties:
rel:
type: "string"
description: "Always \"up\""
href:
type: "string"
description: "Link URI"
method:
type: "string"
description: "Always \"GET\""
EventList:
type: "object"
required:
- "links"
- "metadata"
- "values"
properties:
links:
required:
- "events__create"
- "events__self"
type: "object"
description: "HATEOAS Links"
properties:
events__self:
required:
- "href"
- "method"
- "rel"
type: "object"
properties:
rel:
type: "string"
description: "Always \"self\""
href:
type: "string"
description: "Link URI"
method:
type: "string"
description: "Always \"GET\""
events__prev:
required:
- "href"
- "method"
- "rel"
type: "object"
properties:
rel:
type: "string"
description: "Always \"previous\""
href:
type: "string"
description: "Link URI"
method:
type: "string"
description: "Always \"GET\""
events__next:
required:
- "href"
- "method"
- "rel"
type: "object"
properties:
rel:
type: "string"
description: "Always \"next\""
href:
type: "string"
description: "Link URI"
method:
type: "string"
description: "Always \"GET\""
events__create:
required:
- "href"
- "method"
- "rel"
type: "object"
properties:
rel:
type: "string"
description: "Always \"events__create\""
href:
type: "string"
description: "Link URI"
method:
type: "string"
description: "Always \"POST\""
metadata:
required:
- "collection_size"
- "default_page_size"
- "max_page_size"
- "page_end"
- "page_size"
- "page_start"
type: "object"
description: "Object Metadata"
properties:
collection_size:
type: "integer"
format: "int32"
description: "Total size of the collection (not the size of the response)"
minimum: 0
default_page_size:
type: "integer"
format: "int32"
description: "Default value of page_size. Always \"100\"."
default: 100
max_page_size:
type: "integer"
format: "int32"
description: "Maximum allowed value of page_size. Always \"1000\"."
default: 1000
page_size:
type: "integer"
format: "int32"
description: "Number of results in the response"
minimum: 0
maximum: 1000
page_start:
type: "integer"
format: "int32"
description: "Index of the first item in the response"
minimum: 0
page_end:
type: "integer"
format: "int32"
description: "Index of the last item included in the response"
minimum: 0
values:
type: "array"
description: "Collection Values"
items:
$ref: "#/definitions/Event"
EventBody:
type: "object"
required:
- "content"
- "content_type"
properties:
content_type:
type: "string"
description: "MIME type of the body"
enum:
- "text/plain"
- "text/html"
content:
type: "string"
description: "Content Body"
description: "Event Body Text"
EventAttendee:
type: "object"
required:
- "email"
- "response"
- "type"
properties:
email:
type: "string"
type:
$ref: "#/definitions/AttendeeType"
response:
type: "string"
enum:
- "none"
- "organizer"
- "tentative"
- "accepted"
- "declined"
- "not_responded"
response_time:
type: "string"
format: "date-time"
description: "Time when the response was sent"
EventRecipient:
type: "object"
required:
- "email"
properties:
email:
type: "string"
Recurrence:
type: "object"
required:
- "pattern"
properties:
pattern:
required:
- "type"
type: "object"
properties:
type:
$ref: "#/definitions/RecurrenceType"
interval:
type: "integer"
day_of_month:
type: "integer"
format: "int8"
description: "Day of the month on which the event occurs"
minimum: 1
maximum: 31
month:
$ref: "#/definitions/Month"
days_of_week:
type: "array"
description: "Days of the week on which an event occurs"
items:
$ref: "#/definitions/DayOfWeek"
week_index:
type: "integer"
format: "int8"
description: "Week of the month in which an event occurs"
minimum: 1
maximum: 5
range:
required:
- "start_date"
- "type"
type: "object"
properties:
type:
type: "string"
enum:
- "end_date"
- "no_end"
- "numbered"
start_date:
type: "string"
format: "date"
description: "Start date of the series"
end_date:
type: "string"
format: "date"
description: "End date of the series"
number_of_occurrences:
type: "integer"
format: "int32"
description: "How many times the event repeats"
minimum: 1
RecurrenceType:
type: "string"
enum:
- "daily"
- "weekly"
- "absolute_monthly"
- "relative_monthly"
- "absolute_yearly"
- "relative_yearly"
Month:
type: "string"
enum:
- "january"
- "february"
- "march"
- "april"
- "may"
- "june"
- "july"
- "august"
- "september"
- "october"
- "november"
- "december"
DayOfWeek:
type: "string"
enum:
- "monday"
- "tuesday"
- "wednesday"
- "thursday"
- "friday"
- "saturday"
- "sunday"
InvitedAttendee:
type: "object"
required:
- "email"
- "type"
properties:
email:
type: "string"
type:
$ref: "#/definitions/AttendeeType"
AttendeeType:
type: "string"
enum:
- "required"
- "optional"
- "resource"
EventImportance:
type: "string"
enum:
- "low"
- "normal"
- "high"
default: "normal"
EventSensitivity:
type: "string"
enum:
- "normal"
- "personal"
- "private"
- "confidential"
default: "normal"
EventFreeBusy:
type: "string"
enum:
- "free"
- "tentative"
- "busy"
- "out_of_office"
- "working_elsewhere"
- "unknown"
default: "busy"
EventType:
type: "string"
enum:
- "single"
- "occurrence"
- "exception"
- "series"
default: "single"
UpdateEvent:
type: "object"
properties:
start_date_time:
type: "string"
format: "date-time"
description: "Date/Time at which the event starts"
example: "2016-02-28T16:41:41.090Z"
end_date_time:
type: "string"
format: "date-time"
description: "Date/Time at which the event ends"
example: "2016-02-28T16:41:41.090Z"
body:
$ref: "#/definitions/EventBody"
attendees:
type: "array"
items:
$ref: "#/definitions/InvitedAttendee"
importance:
$ref: "#/definitions/EventImportance"
organizer:
$ref: "#/definitions/EventRecipient"
response_requested:
type: "boolean"
sensitivity:
$ref: "#/definitions/EventSensitivity"
recurring_series_id:
type: "string"
description: "ID of the parent event series, if the event is one in a recurring\
\ sequence."
show_as:
$ref: "#/definitions/EventFreeBusy"
event_type:
$ref: "#/definitions/EventType"
is_all_day:
type: "boolean"
reminder_minutes_before_start:
type: "integer"
format: "int32"
minimum: 0
description: "Updates an event. All fields which are present in the request will\
\ be set; those that are present but are null will be set to null (if allowed)"
Error:
type: "object"
required:
- "metadata"
properties:
metadata:
required:
- "validation_information"
- "validation_result"
type: "object"
properties:
validation_result:
required:
- "code"
- "message"
type: "object"
properties:
code:
type: "integer"
format: "int8"
description: "Numerical error code"
message:
type: "string"
description: "Error Message"
validation_information:
type: "array"
description: "Array of strings describing the failures."
items:
type: "string"
BatchCreateEvents:
type: "object"
additionalProperties:
$ref: "#/definitions/CreateEvent"
BatchResponse:
type: "object"
properties:
'*':
required:
- "success"
- "validation_response"
type: "object"
properties:
success:
type: "boolean"
validation_response:
required:
- "code"
- "message"
type: "object"
properties:
code:
type: "integer"
format: "int8"
default: 200
message:
type: "string"
validation_information:
type: "array"
items:
type: "string"
links:
required:
- "self"
type: "object"
properties:
self:
required:
- "href"
- "method"
- "rel"
type: "object"
properties:
rel:
type: "string"
description: "Always \"self\""
href:
type: "string"
description: "URI of created event"
method:
type: "string"
description: "Always GET"
enum:
- "GET"
BatchUpdateEvents:
type: "object"
additionalProperties:
$ref: "#/definitions/UpdateEvent"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment