This page is a
translated version of the page
Exchange and the translation is 100% complete.
Working with Microsoft Exchange
methods to work with Microsoft Exchange
iRidium server provides capabilities to interact with existing corporate systems built on the basis of Microsoft Exchange Server, a software product to exchange e-mails and common work with the calendar and tasks. iRidium server can be connected to Microsoft Exchange system to:
- get events in the calendar
- get contacts
- create meetings
- delete items
Work with Microsoft Exchange is available only via script.
Driver supports Basic Authentication only.
Methods
IR.CreateDevice()
Creating a driver to work with Microsoft Exchange Server
Syntax
IR.CreateDevice(IR.DEVICE_EXCHANGE, name, host, port, login, password);
name
|
"ExchangeDriver"
|
type: string Name of the driver that is created
|
host
|
"192.168.0.12"
|
type: string IP address of Microsoft Exchange Server
|
port
|
905
|
type: number Port
|
login
|
"admin"
|
type: string Login of Microsoft Exchange account
|
password
|
"admin"
|
type: string Password to Microsoft Exchange account
Driver supports Basic Authentication only.
|
-
Sample
var device = IR.CreateDevice(IR.DEVICE_EXCHANGE, "ExchDriver", "192.168.0.12", 905, "admin", "admin");
IR.Log(device); // [object DevicePrototype]
In case a connection attempt to Microsoft Exchange server fails, the driver will continue trying every 15 seconds.
.GetCalendar()
Getting calendar events
Syntax
.GetCalendar({FirstDate, LastDate, Email, Callback});
FirstDate
|
"2016-09-16T07:00:00Z"
|
type: string date and time of event start
|
LastDate
|
"2016-11-16T07:00:00Z"
|
type: string data and time of event end
|
Email
|
"admin@mycompany.ru"
|
type: string e-mail address to which an event is assigned
|
Callback
|
function(eventList, email)
|
type: function Function where the server sends a list of events
|
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 List of events. Each event has the following fields: ID (item ID), ChangeKey (item key), Start (start of event), End (end of event), Subject (Subject of a meeting), Organizer (organizer), Location (location)
|
email
|
"admin@mycompany.ru"
|
type: string e-mail address to which an event is assigned
|
Sample
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()
Getting information about a contact
Syntax
.GetContact({Find, Callback});
Find
|
"admin"
|
type: string search line (part of name or e-mail)
|
Callback
|
function(contactList, find)
|
type: function Function where the server sends a list of contacts
|
contactList
|
{ Name: "L. Johnson", Company: "Iridium Ltd.", Email: "admin@admin.ru", Fax: "3435111222", BusinessPhone: "3435333222", Phone: "3435222333", MobilePhone: "+79001111111", Department: "R&D", Office: "General str. 1", JobTitle: "Trainer" }
|
type: object contact array, that do with a line. Each contact has the following fields: Name, Company, Email, Fax, BusinessPhone, Phone, MobilePhone, Department, Office (office address), JobTitle
|
find
|
"admin"
|
type: string Search line
|
Sample
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()
Creating a meeting
Syntax
.CreateAppointment({Email, FirstDate, LastDate, Room, Subject, Callback});
Email
|
"admin@admin.ru"
|
type: string e-mail address to which an event is assigned
|
FirstDate
|
"2016-09-16T07:00:00Z"
|
type: string date and time of event start
|
LastDate
|
"2016-09-20T07:00:00Z"
|
type: string date and time of event end
|
Room
|
"526"
|
type: string Room where a meeting will take place
|
Subject
|
"Scrum meeting"
|
type: string The subject of the meeting
|
Callback
|
function(appointment)
|
type: function function where an answer from the server comes
|
appointment
|
{ ID: "AAMkA", ChangeKey: "DwAAAB" }
|
type: object object where information about a created meeting is stored ID (meeting ID), ChangeKey (key of a created meeting), Error (text of error if there is any)
|
Sample
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()
Deleting an item
Syntax
.DeleteItem({ID, ChangeKey, Callback});
ID
|
"AAMkA"
|
type: string item ID
|
ChangeKey
|
"DwAAAB"
|
type: string item key
|
Callback
|
function(itemStatus)
|
type: function function where an answer from the server comes
|
itemStatus
|
{ Deleted: true } or { Error: "ResponseCode: ErrorNameResolutionNoResults, MessageText: No results were found." }
|
type: object an object that stores information about a deleted item: Deleted (deletion flag), Error (error text, if there is any)
|
Sample
function DeletingFeedback(itemStatus){
if (itemStatus.Deleted)
{
IR.Log("Deleted!");
}
else
{
IR.Log("Error: " + itemStatus.Error);
}
}
device.DeleteItem({ID: "AAMkA", ChangeKey: "DwAAAB", Callback: DeletingFeedback});
.SendMail()
Sending an e-mail
Syntax
.SendMail ({Email, Subject, Body, Callback});
Email
|
"admin@mycompany.ru"
|
type: type: string e-mail address of the receiver
|
Subject
|
"Subject"
|
type: string Topic of the letter
|
Body
|
"Message"
|
type: string Text of the letter
|
Callback
|
function(SendingFeedback)
|
type: function function that returns an answer from a server
|
MessageStatus
|
Sent: true
|
type: object Object where information about a sent e-mail is stored :Sent (sent flag)
|
Sample
function SendingFeedback (MessageStatus)
{
IR.Log("Sent: " + MessageStatus.Sent);
}
device.SendMail({
Email: 'admin@admin.ru',
Subject: 'Subject',
Body: 'Message',
Callback: SendingFeedback });
Driver parameters
SSL
SSL
|
1
|
type: number Method to encrypt messages between iRidium server and Microsoft Exchange Server:
0 - without encrypting (by default),
1 - TLS v1.2 (recommended),
2 - SSL 2.3,
3 - SSL 3.0.
|
device.SetParameters({"SSL": 1}); // TLS encryption