Sends an email to any email address NOTE - ONE of message_plaintext OR message_html IS required.
Security Level: Support
Parameters
Name
Required?
Type
Default
Description
to
true
String OR Array(String)
N/A
the destation of the email
subject
true
String
N/A
The subject line of the email
message_plaintext
false
String
nil
The message body of the email
message_html
false
String
nil
The message body of the email that will be displayed as HTML
resource_attachments
false
Array(ResourceAttachment)
[]
Array of objects to be attached to the email
cc
false
String OR Array(String)
[]
---
bcc
false
String OR Array(String)
[]
---
from
false
String Or Array(String) Or Nil
nil
---
Response Schema
Example Responses
1. If the email is not registered to a user
{
"error": "request failed",
"sys_id": "sys-E7A7jh9V4U",
"module_name": "Calendar",
"index": 1,
"message": "module raised: \"email_or_office_userPrincipalName\" is invalid as a mail address. (EMail::Error::AddressError)",
"backtrace": [
"repositories/drivers/lib/email/src/email/address.cr:16:5 in 'valid_address!'",
"repositories/drivers/lib/email/src/email/address.cr:32:13 in 'initialize'",
"repositories/drivers/lib/email/src/email/address.cr:31:3 in 'new'",
"repositories/drivers/lib/email/src/email/header.cr:114:16 in 'add'",
"repositories/drivers/lib/email/src/email/message.cr:415:3 in 'from'",
"repositories/drivers/lib/place_calendar/src/google.cr:447:7 in 'send_mail'",
"repositories/drivers/drivers/place/calendar_common.cr:142:14 in 'send_mail'",
"repositories/drivers/drivers/place/calendar.cr:3:1 in '->'",
"repositories/drivers/drivers/place/calendar.cr:3:1 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:164:5 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver.cr:522:1 in 'run_execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:262:24 in 'process'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:179:7 in '->'",
"/usr/share/crystal/src/fiber.cr:146:11 in 'run'",
"/usr/share/crystal/src/fiber.cr:98:34 in '->'",
"???"
]
}
access_token
Generates an access token for an admin to log in to Microsoft services as a given user.
Security Level: Admin
Parameters
Name
Required?
Type
Default
Description
user_id
false
String
nil
email address of the user as registered in BackOffice
Response Schema
Example Responses
1. If user does not exist:
{
"error": "request failed",
"sys_id": "sys-E7A7jh9V4U",
"module_name": "Calendar",
"index": 1,
"message": "module raised: Bad Request\n{\n \"error\": \"invalid_request\",\n \"error_description\": \"Invalid impersonation \\u0026quot;sub\\u0026quot; field: H84U9JLbocG\"\n} (Google::Exception)",
"backtrace": [
"repositories/drivers/lib/google/src/google.cr:25:9 in 'raise_on_failure'",
"repositories/drivers/lib/google/src/auth/service_auth.cr:50:7 in 'get_token'",
"repositories/drivers/lib/place_calendar/src/google.cr:67:15 in 'access_token'",
"repositories/drivers/lib/place_calendar/src/place_calendar.cr:23:5 in 'access_token'",
"repositories/drivers/drivers/place/calendar_common.cr:158:14 in 'access_token'",
"repositories/drivers/drivers/place/calendar.cr:3:1 in '->'",
"repositories/drivers/drivers/place/calendar.cr:3:1 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:164:5 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver.cr:522:1 in 'run_execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:262:24 in 'process'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:179:7 in '->'",
"/usr/share/crystal/src/fiber.cr:146:11 in 'run'",
"/usr/share/crystal/src/fiber.cr:98:34 in '->'",
"???"
]
}
{
"error": "request failed",
"sys_id": "sys-EJhU_4DEvQ",
"module_name": "Calendar",
"index": 1,
"message": "module raised: Forbidden (PlaceCalendar::Exception)",
"backtrace": [
"repositories/drivers/lib/place_calendar/src/office365.cr:420:7 in 'handle_office365_exception'",
"repositories/drivers/lib/place_calendar/src/office365.cr:85:7 in 'get_user'",
"repositories/drivers/lib/place_calendar/src/office365.cr:93:9 in 'get_user_by_email'",
"repositories/drivers/lib/place_calendar/src/place_calendar.cr:23:5 in 'get_user_by_email'",
"repositories/drivers/drivers/place/calendar_common.cr:182:14 in 'get_user'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in '->'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:164:5 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver.cr:522:1 in 'run_execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:262:24 in 'process'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:179:7 in '->'",
"/usr/share/crystal/src/fiber.cr:146:11 in 'run'",
"/usr/share/crystal/src/fiber.cr:98:34 in '->'",
"???"
]
}
list_calendars
Lists the calendars that belong to a user, specified by their email as registered in BackOffice.
{
"error": "request failed",
"sys_id": "sys-EJhU_4DEvQ",
"module_name": "Calendar",
"index": 1,
"message": "module raised: Not Found (PlaceCalendar::Exception)",
"backtrace": [
"repositories/drivers/lib/place_calendar/src/office365.cr:420:7 in 'handle_office365_exception'",
"repositories/drivers/lib/place_calendar/src/office365.cr:138:7 in 'list_calendars'",
"repositories/drivers/lib/place_calendar/src/place_calendar.cr:23:5 in 'list_calendars'",
"repositories/drivers/drivers/place/calendar_common.cr:188:14 in 'list_calendars'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in '->'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:164:5 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver.cr:522:1 in 'run_execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:262:24 in 'process'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:179:7 in '->'",
"/usr/share/crystal/src/fiber.cr:146:11 in 'run'",
"/usr/share/crystal/src/fiber.cr:98:34 in '->'",
"???"
]
}
get_user_manager
Gets the registered manager of a given user
Security Level: Support
Parameters
Name
Required?
Type
Default
Description
user_id
true
String
N/A
The email of the user to search
Response Schema
Example Responses
1. If user does not have a registered manager:
{
"error": "request failed",
"sys_id": "sys-Ewmyx8wEF_",
"module_name": "Calendar",
"index": 1,
"message": "module raised: Not Found (Office365::Exception)",
"backtrace": [
"repositories/drivers/lib/office365/src/client.cr:132:9 in 'graph_request'",
"repositories/drivers/lib/office365/src/users.cr:39:22 in 'get_user_manager'",
"repositories/drivers/drivers/place/calendar_common.cr:197:9 in 'get_user_manager'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in '->'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:164:5 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver.cr:522:1 in 'run_execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:262:24 in 'process'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:179:7 in '->'",
"/usr/share/crystal/src/fiber.cr:146:11 in 'run'",
"/usr/share/crystal/src/fiber.cr:98:34 in '->'",
"???"
]
}
list_groups
Lists all groups if no parameters entered.
Security Level: Support
Parameters
Name
Required?
Type
Default
Description
query
false
String
nil
filters search results by whether the query appears in the "name"
Response Schema
Example Responses
1.
[
{
"id": "0013fdgd63-7bd8-4e8d-92d4-ea3dfgfg7d38",
"name": "LaptopUsers-Brisbane"
},
{
"id": "0dfgdfcd-dfg6-462d-aa86-8fcaf2dfgdfdf",
"name": "UserAdmins",
"description": "Members can manage users in this forest."
},
{
"id": "00dfgfg3ae-9fdgd-4645-9dbc-a4172a4fdg8e",
"name": "WebVPN"
}
]
get_group
Searches for a group by its group ID, as returned in the "id" section of list_groups UNLIKE with get_user
Security Level: Support
Parameters
Name
Required?
Type
Default
Description
group_id
true
String
N/A
The group ID to use in the search - can be found by using list_groups
{
"error": "request failed",
"sys_id": "sys-Ewmyx8wEF_",
"module_name": "Calendar",
"index": 1,
"message": "module raised: Bad Request (Office365::Exception)",
"backtrace": [
"repositories/drivers/lib/office365/src/client.cr:132:9 in 'graph_request'",
"repositories/drivers/lib/office365/src/groups.cr:41:15 in 'get_group'",
"repositories/drivers/drivers/place/calendar_common.cr:219:9 in 'get_group'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in '->'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:164:5 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver.cr:522:1 in 'run_execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:262:24 in 'process'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:179:7 in '->'",
"/usr/share/crystal/src/fiber.cr:146:11 in 'run'",
"/usr/share/crystal/src/fiber.cr:98:34 in '->'",
"???"
]
}
list_events
Searches for all events happening on a given calendar within a specified time frame.
Security Level: Support
Parameters
Name
Required?
Type
Default
Description
calendar_id
true
String
N/A
The EMAIL of the user OR the EMAIL of the room whose calender you want to search
period_start
true
Int64
N/A
The start of the time period to search in Unix time
period_end
true
Int64
N/A
The end of the period to search in Unix time
time_zone
false
String
nil
filters results by time zone - format: 2/3 letter timezone code e.g UTC, AU
user_id
false
String
nil
filters results by user EMAIL (Only necessary if the calendar_id you are looking up belongs to a room)
include_cancelled
false
Boolean
false
if true, includes cancelled events
Response Schema
Example Responses
1. If the user or room has no events in the given time frame:
[]
4. If the room or user has events within the given time frame:
{
"error": "request failed",
"sys_id": "sys-EJhU_4DEvQ",
"module_name": "Calendar",
"index": 1,
"message": "module raised: Not Found (PlaceCalendar::Exception)",
"backtrace": [
"repositories/drivers/lib/place_calendar/src/office365.cr:420:7 in 'handle_office365_exception'",
"repositories/drivers/lib/place_calendar/src/office365.cr:192:7 in 'list_events:period_start:period_end:showDeleted'",
"repositories/drivers/lib/place_calendar/src/place_calendar.cr:23:5 in 'list_events:period_start:period_end:showDeleted'",
"repositories/drivers/drivers/place/calendar_common.cr:243:7 in 'list_events'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in '->'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:164:5 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver.cr:522:1 in 'run_execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:262:24 in 'process'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:179:7 in '->'",
"/usr/share/crystal/src/fiber.cr:146:11 in 'run'",
"/usr/share/crystal/src/fiber.cr:98:34 in '->'",
"???"
]
}
delete_event
Deletes an event from the calendar. Requires a calendar ID (the email of the room OR a user) AND a meeting ID - a long set of numbers and letters as returned by list_events
Security Level: Support
Parameters
Name
Required?
Type
Default
Description
calendar_id
true
String
N/A
The user Email OR the room EMAIL
event_id
true
String
N/A
The ID of the event as returned by list_events
user_id
false
String
nil
IF the calendar_id is the email of a ROOM, this filters by the email of a user
notify
false
Boolean
false
notifies attendees if set to true
comment
false
String
nil
adds a comment to the cancellation notification
Response Schema
Example Responses
1. If request fails:
{
"error": "request failed",
"sys_id": "sys-Ewmyx8wEF_",
"module_name": "Calendar",
"index": 1,
"message": "module raised: Status 204 should not have a body (ArgumentError)",
"backtrace": [
"/usr/share/crystal/src/http/client/response.cr:20:11 in 'initialize'",
"/usr/share/crystal/src/http/client/response.cr:13:5 in 'new'",
"/usr/share/crystal/src/http/client/response.cr:150:22 in 'from_io?'",
"/usr/share/crystal/src/http/client.cr:604:5 in 'exec_internal_single'",
"/usr/share/crystal/src/http/client.cr:587:18 in 'exec_internal'",
"/usr/share/crystal/src/http/client.cr:581:7 in 'exec'",
"repositories/drivers/lib/office365/src/client.cr:125:7 in 'graph_request'",
"repositories/drivers/lib/office365/src/events.cr:107:16 in 'delete_event:mailbox:calendar_id:id'",
"repositories/drivers/lib/place_calendar/src/office365.cr:239:7 in 'delete_event:calendar_id:notify'",
"repositories/drivers/lib/place_calendar/src/place_calendar.cr:23:5 in 'delete_event:calendar_id:notify'",
"repositories/drivers/drivers/place/calendar_common.cr:275:14 in 'delete_event'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in '->'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:164:5 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver.cr:522:1 in 'run_execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:262:24 in 'process'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:179:7 in '->'",
"/usr/share/crystal/src/fiber.cr:146:11 in 'run'",
"/usr/share/crystal/src/fiber.cr:98:34 in '->'",
"???"
]
}
decline_event
Declines an event from the calendar. Event is still shown but crossed out. Requires a calendar ID (the email of the room OR a user) AND a meeting ID - a long set of numbers and letters as returned by list_events
Security Level: Support
Parameters
Name
Required?
Type
Default
Description
calendar_id
true
String
N/A
The user Email OR the room EMAIL
event_id
true
String
N/A
The ID of the event as returned by list_events
user_id
false
String
nil
IF the calendar_id is the email of a ROOM, this filters by the email of a user
notify
false
Boolean
false
notifies attendees if set to true
comment
false
String
nil
adds a comment to the cancellation notification
Response Schema
Example Responses
1. If request fails:
{
"error": "request failed",
"sys_id": "sys-EJhU_4DEvQ",
"module_name": "Calendar",
"index": 1,
"message": "module raised: Not Found (PlaceCalendar::Exception)",
"backtrace": [
"repositories/drivers/lib/place_calendar/src/office365.cr:420:7 in 'handle_office365_exception'",
"repositories/drivers/lib/place_calendar/src/office365.cr:251:7 in 'decline_event:calendar_id:notify:comment'",
"repositories/drivers/lib/place_calendar/src/place_calendar.cr:23:5 in 'decline_event:calendar_id:notify:comment'",
"repositories/drivers/drivers/place/calendar_common.cr:266:14 in 'decline_event'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in '->'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:164:5 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver.cr:522:1 in 'run_execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:262:24 in 'process'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:179:7 in '->'",
"/usr/share/crystal/src/fiber.cr:146:11 in 'run'",
"/usr/share/crystal/src/fiber.cr:98:34 in '->'",
"???"
]
}
create_event
Creates an event
Security Level: Support
Parameters
Name
Required?
Type
Default
Description
title
true
String
N/A
The title of the event
event_start
true
Int64
N/A
Start time of the event in Unix time
event_end
false
String
N/A
End time of the even in Unix time
description
false
String
N/A
description of the event sent to the attendees
attendees
false
String/Array(String)
nil
---
location
false
String
nil
Shown on the invitation, human-readable name
timezone
false
String
nil
2/3 letter timezone code - affects time meeting may appear for all users
user_id
false
String
nil
The SERVER user to create the event AS
calendar_id
false
String
nil
The EMAIL of the ROOM
online_meeting_id
false
String
nil
Need to generate meeting with provider first, these details will be provided by then
online_meeting_provider
false
String
nil
Need to generate meeting with provider first, these details will be provided by them
online_meeting_url
false
String
nil
Need to generate meeting with provider first, these details will be provided by them
online_meeting_sip
false
String
nil
Need to generate meeting with provider first, these details will be provided by them
online_meeting_phones
false
String
nil
Need to generate meeting with provider first, these details will be provided by them
online_meeting_pin
false
String
nil
Need to generate meeting with provider first, these details will be provided by them
#### Response Schema
```
```
Example Responses
1. If request fails:
{
"error": "request failed",
"sys_id": "sys-Ewmyx8wEF_",
"module_name": "Calendar",
"index": 1,
"message": "module raised: Not Found (PlaceCalendar::Exception)",
"backtrace": [
"repositories/drivers/lib/place_calendar/src/office365.cr:420:7 in 'handle_office365_exception'",
"repositories/drivers/lib/place_calendar/src/office365.cr:213:7 in 'create_event'",
"repositories/drivers/lib/place_calendar/src/place_calendar.cr:23:5 in 'create_event'",
"repositories/drivers/drivers/place/calendar_common.cr:322:14 in 'create_event'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in '->'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:164:5 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver.cr:522:1 in 'run_execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:262:24 in 'process'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:179:7 in '->'",
"/usr/share/crystal/src/fiber.cr:146:11 in 'run'",
"/usr/share/crystal/src/fiber.cr:98:34 in '->'",
"???"
]
}
send_template
Send an email template you have created to given users to get specific responses back from them.
Parameters
| Name | Required? | Type | Default | Description | | to | true | String | N/A | email to send the template to | | template | true | String | N/A | template to send | | args | true | String | N/A | --- | | resource_attachments | false | String/Array(string) | [] | --- | | attachments | false | String/Array(string) | [] | --- | | cc | false | String/Array(string) | [] | --- | | bcc | false | String/Array(string) | [] | --- | | from | false | String | null | optional email to use as sender |
Response Schema
Example Responses
1. If request fails:
{
"error": "request failed",
"sys_id": "sys-Ewmyx8wEF_",
"module_name": "Calendar",
"index": 1,
"message": "module raised: Not Found (PlaceCalendar::Exception)",
"backtrace": [
"repositories/drivers/lib/place_calendar/src/office365.cr:420:7 in 'handle_office365_exception'",
"repositories/drivers/lib/place_calendar/src/office365.cr:213:7 in 'create_event'",
"repositories/drivers/lib/place_calendar/src/place_calendar.cr:23:5 in 'create_event'",
"repositories/drivers/drivers/place/calendar_common.cr:322:14 in 'create_event'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in '->'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:164:5 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver.cr:522:1 in 'run_execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:262:24 in 'process'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:179:7 in '->'",
"/usr/share/crystal/src/fiber.cr:146:11 in 'run'",
"/usr/share/crystal/src/fiber.cr:98:34 in '->'",
"???"
]
}
build_template
Generates an email template to be used for questionaires/to generate specific responses
{
"error": "request failed",
"sys_id": "sys-Ewmyx8wEF_",
"module_name": "Calendar",
"index": 1,
"message": "module raised: Not Found (PlaceCalendar::Exception)",
"backtrace": [
"repositories/drivers/lib/place_calendar/src/office365.cr:420:7 in 'handle_office365_exception'",
"repositories/drivers/lib/place_calendar/src/office365.cr:213:7 in 'create_event'",
"repositories/drivers/lib/place_calendar/src/place_calendar.cr:23:5 in 'create_event'",
"repositories/drivers/drivers/place/calendar_common.cr:322:14 in 'create_event'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in '->'",
"repositories/drivers/drivers/microsoft/graph_api.cr:3:1 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:164:5 in 'execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver.cr:522:1 in 'run_execute'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:262:24 in 'process'",
"repositories/drivers/lib/placeos-driver/src/placeos-driver/driver_manager.cr:179:7 in '->'",
"/usr/share/crystal/src/fiber.cr:146:11 in 'run'",
"/usr/share/crystal/src/fiber.cr:98:34 in '->'",
"???"
]
}