- Reference
- Microsoft Exchange
Working with Microsoft Exchange
Methods for working with Microsoft Exchange
iRidi server provides functionality for interacting with existing corporate systems based on Microsoft Exchange Server, a software product for e-mail and collaborative calendar and task management. You can connect iRidi server to Microsoft Exchange to:
- retrieve calendar events
- retrieve contacts
- create appointments
- delete items
Microsoft Exchange is accessible only through scripts.
- The driver supports only Basic Authentication.
The extended Microsoft Exchange Web Services driver article is hidden from public access.
Methods
IR.CreateDevice()
Create a driver for working with a Microsoft Exchange server
Syntax
IR.CreateDevice(IR.DEVICE_EXCHANGE, name, host, port, login, password);
| Input | Value | Description |
|---|---|---|
| name | "ExchangeDriver" | type: string Name of the driver to create |
| host | "192.168.0.12" | type: string Microsoft Exchange server IP address |
| port | 905 | type: number Port |
| login | "admin" | type: string Microsoft Exchange account login |
| password | "admin" | type: string Microsoft Exchange account password * The driver supports only Basic Authentication. |
| Output | ||
|---|---|---|
| - |
Example
var device = IR.CreateDevice(IR.DEVICE_EXCHANGE, "ExchDriver", "192.168.0.12", 905, "admin", "admin");
IR.Log(device); // [object DevicePrototype]
Notes
If a connection attempt to the Microsoft Exchange server fails, the driver retries every 15 seconds.
.GetCalendar()
Retrieve calendar events
Syntax
.GetCalendar({FirstDate, LastDate, Email, Callback});
| Input | Value | Description |
|---|---|---|
| FirstDate | "2016-09-16T07:00:00Z" | type: string event start date and time |
| LastDate | "2016-11-16T07:00:00Z" | type: string event end date and time |
| "admin@mycompany.ru" | type: string e-mail address associated with the event | |
| Callback | function(eventList, email) | type: function Function to which the server passes the event list |
| Output | ||
|---|---|---|
| eventList | {ID: "AAMkA",ChangeKey: "DwAAAB",Start: "2016-09-16T07:00:00Z",End: "2016-11-16T07:00:00Z",Subject: "IT Conference",Organizer: "K. Johnson",Location: "London"} | type: object Event list. Each event has these fields: ID (item identifier), ChangeKey (item key), Start (event start), End (event end), Subject (appointment title), Organizer (organizer), Location (venue) |
admin@mycompany.ru | type: string e-mail address associated with the event |
Example
function GetFirstEventData(eventList, email)
{
IR.Log("event id: " + eventList.items[0].ID);
IR.Log("event key: " + eventList.items[0].ChangeKey);
IR.Log("event start: " + eventList.items[0].Start);
IR.Log("event end: " + eventList.items[0].End);
IR.Log("event subject: " + eventList.items[0].Subject);
IR.Log("event organizer: " + eventList.items[0].Organizer);
IR.Log("event location: " + eventList.items[0].Location);
}
device.GetCalendar({
FirstDate: "2016-09-16T07:00:00Z",
LastDate: "2016-09-20T07:00:00Z",
Email: "admin@admin.ru",
Callback: GetFirstEventData});
.GetContact()
Retrieve contact information
Syntax
.GetContact({Find, Callback});
| Input | Value | Description |
|---|---|---|
| Find | "admin" | type: string search string (part of a name or e-mail address) |
| Callback | function(contactList, find) | type: function Function to which the server passes the contact list |
| Output | ||
|---|---|---|
| contactList | {Name: "L. Johnson",Company: "Iridium Ltd.",Email: "admin@admin.ru",Fax: "3435111222",BusinessPhone: "3435333222",Phone: "3435222333",MobilePhone: "+79001111111",Department: "R&D",ffice: "General str. 1",JobTitle: "Trainer"} | type: object list of contacts matching the search string. Each contact has these fields: Name (contact name), Company (company), Email (contact e-mail address), Fax (contact fax), BusinessPhone (work phone), Phone (phone), MobilePhone (mobile phone), Department (department), Office (office address), JobTitle (job title) |
| find | "admin" | type: string Search string |
Example
function GetFirstContactData(contactList, find)
{
IR.Log("Contact Name: " + contactList.Items[0].Name);
IR.Log("Contact Company: " + contactList.Items[0].Company);
IR.Log("Contact Email: " + contactList.Items[0].Email);
IR.Log("Contact Fax: " + contactList.Items[0].Fax);
IR.Log("Contact BusinessPhone: " + contactList.Items[0].BusinessPhone);
IR.Log("Contact Phone: " + contactList.Items[0].Phone);
IR.Log("Contact MobilePhone: " + contactList.Items[0].MobilePhone);
IR.Log("Contact Department: " + contactList.Items[0].Department);
IR.Log("Contact Office: " + contactList.Items[0].Office);
IR.Log("Contact JobTitle: " + contactList.Items[0].JobTitle);
}
device.GetContact({Find: "admin", Callback: GetFirstContactData});
.CreateAppointment()
Create an appointment
Syntax
.CreateAppointment({Email, FirstDate, LastDate, Room, Subject, Callback});
| Input | Value | Description |
|---|---|---|
| "admin@admin.ru" | type: string e-mail address associated with the event | |
| FirstDate | "2016-09-16T07:00:00Z" | type: string event start date and time |
| LastDate | "2016-09-20T07:00:00Z" | type: string event end date and time |
| Room | "526" | type: string Room where the appointment will take place |
| Subject | "Scrum meeting" | type: string Appointment subject |
| Callback | function(appointment) | type: function function that returns the server response |
| Output | ||
|---|---|---|
| appointment | {ID: "AAMkA",ChangeKey: "DwAAAB"} | type: object object containing information about the created appointment: ID (appointment identifier), ChangeKey (created appointment key), Error (error text, if any) |
Example
function FeedbackInfo(appointment)
{
IR.Log("ID: " + appointment.ID);
IR.Log("ChangeKey: " + appointment.ChangeKey);
IR.Log("Error: " + appointment.Error);
}
device.CreateAppointment({
Email: "admin@admin.ru",
FirstDate: "2016-09-16T07:00:00Z",
LastDate: "2016-09-20T07:00:00Z",
Room: "520",
Subject: "Scrum meeting",
Callback: FeedbackInfo});
.DeleteItem()
Delete an item
Syntax
.DeleteItem({ID, ChangeKey, Callback});
| Input | Value | Description |
|---|---|---|
| ID | "AAMkA" | type: string item identifier |
| ChangeKey | "DwAAAB" | type: string item key |
| Callback | function(itemStatus) | type: function function that returns the server response |
| Output | ||
|---|---|---|
| itemStatus | {Deleted: true}or {Error: "ResponseCode: ErrorNameResolutionNoResults, MessageText: No results were found."} | type: object object containing information about the deleted item: Deleted (deletion flag), Error (error text, if any) |
Example
function DeletingFeedback(itemStatus){
if (itemStatus.Deleted)
{
IR.Log("Deleted!");
}
else
{
IR.Log("Error: " + itemStatus.Error);
}
}
device.DeleteItem({ID: "AAMkA", ChangeKey: "DwAAAB", Callback: DeletingFeedback});
.SendMail()
Send an e-mail
Syntax
.SendMail ({Email, Subject, Body, Callback});
| Input | Value | Description |
|---|---|---|
| "admin@mycompany.ru" | type: type recipient e-mail address: string | |
| Subject | "Subject" | type: string E-mail subject |
| Body | "Message" | type: string E-mail body |
| Callback | function(SendingFeedback) | type: function function that returns the server response |
| Output | ||
|---|---|---|
| MessageStatus | Sent: true | type: object Object containing information about the sent e-mail:Sent (sent flag) |
Example
function SendingFeedback (MessageStatus)
{
IR.Log("Sent: " + MessageStatus.Sent);
}
device.SendMail({
Email: 'admin@admin.ru',
Subject: 'Subject',
Body: 'Message',
Callback: SendingFeedback });
Driver parameters
SSL
| Parameter | Value | Description |
|---|---|---|
| SSL | 1 | type: number Message encryption method between iRidi server and Microsoft Exchange Server: 0 - no encryption (default) 1 - TLS v1.2 (recommended) 2 - SSL 2.3 3 - SSL 3.0 |
device.SetParameters({"SSL": 1}); // TLS encryption