Материал из for iRidium developers
Перейти к: навигация, поиск
Эта страница является переводом страницы Exchange. Перевод выполнен на 100%.

Other languages:
English • ‎русский

Work with MS Exchange

methods to work with MS Exchange

Microsoft Exchange Server is a software product for message exchange and mutual work. Basic functions of Microsoft Exchange: processing and sending e-mail messages, mutual access to calendars and tasks. Starting with 1.2.3 version of i3 pro app MS Exchange can be connected to a project to

  • get events in the calendar
  • get contacts
  • create meetings
  • delete items

Work with MS Exchange is available onlt via script.

Methods

IR.CreateDevice

Creating a driver to work with MS Exchange

Syntax

IR.CreateDevice(IR.DEVICE_EXCHANGE, name, host, port, login, password);

input value description
name "ExchangeDriver" type: string
Driver name
host "192.168.0.12" type: string
Driver IP address
port "905" type: Number
Port
login "admin" type: string
Login of MS Exchange account
password "admin" type: string
Password to MS Exchange account
output

-


Sample

IR.CreateDevice(IR.DEVICE_EXCHANGE, "ExchangeDriver", "192.168.0.12", 905, "admin", "admin");

{{{attentions}}}

GetCalendar

Getting calendar events

Syntax

device.GetCalendar({Callback, FirstDate, LastDate, Email});

input value description
Callback answer(result, email) type: function
Function where the server sends a list of events
FirstDate "2016-09-16T07:00:00Z" type: string
data and time counting from which events must be found
LastDate "2016-011-16T07:00:00Z" type: string
data and time till which events have to be found
Email "admin@mycompany.ru" type: string
E-mail address to which an event is asigned
output

The answer from the server returns to Callback function that was indicated as the input parameter of the function

result object type: object
data array. 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 asigned


Sample

function GetEvents(result, email)
{
  IR.Log("event id: " + result.items[0].ID);
  IR.Log("event key: " + result.items[0].ChangeKey);
  IR.Log("event start: " + result.items[0].Start);
  IR.Log("event end: " + result.items[0].End);
  IR.Log("event subject: " + result.items[0].Subject);
  IR.Log("event organizer: " + result.items[0].Organizer);
  IR.Log("event location: " + result.items[0].Location);
}
 
device.GetCalendar({GetEvents(result, email),"2016-09-16T07:00:00Z","2016-09-20T07:00:00Z",admin@admin.ru});

{{{attentions}}}

GetContact

Getting information about a contact

Syntax

device.GetContact({Callback, Find});

input value description
Callback answer(result, find) type: function
Function where the server sends a list of events
find "admin" type: string
search line (part of name or e-mail)
output

The answer from the server returns to Callback function that was indicated as the input parameter of the function

result object type: object
contact array, that do with a line. Each contact has the following fields:
Name(contact name),
Company(company),
email(contact's e-mail),
Fax(contact's fax),
BussinessPhone(business phone ),
Phone(phone),
MobilePhone(cell phone),
Department(department),
Office(office address), JobTitle(job title)
find "admin" type: string
Search line


Sample

function GetContacts(result, find)
{
  IR.Log("Contact Name: " + result.items[0].Name);
  IR.Log("Contact Company: " + result.items[0].Company);
  IR.Log("Contact Email: " + result.items[0].Email);
  IR.Log("Contact Fax: " + result.items[0].Fax);
  IR.Log("Contact BusinessPhone: " + result.items[0].BusinessPhone);
  IR.Log("Contact Phone: " + result.items[0].Phone);
  IR.Log("Contact MobilePhone: " + result.items[0].MobilePhone);
  IR.Log("Contact Department: " + result.items[0].Department);
  IR.Log("Contact Office: " + result.items[0].Office);
  IR.Log("Contact JobTitle: " + result.items[0].JobTitle);
}
 
device.GetContact({GetContacts(result, find),"admin"});

{{{attentions}}}

CreateAppointment

Creating a meeting

Syntax

device.CreateAppointment({Callback, Email, FirstDate, LastDate, Room, Subject});

input value description
Callback "MeetingName" type: string
function where an answer from the server comes
Email "admin@admin.ru" type: string
address to which an event is asigned
FirstDate "2016-09-16T07:00:00Z" type: Number
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
output

The answer from the server returns to Callback function that was indicated as the input parameter of the function

result object 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 any)


Sample

function FeedbackInfo(result, email)
{
  IR.Log("ID: " + result.ID);
  IR.Log("ChangeKey: " + result.ChangeKey);
  IR.Log("Error: " + result.Error);
}
 
device.CreateAppointment({FeedbackInfo(result, find),"admin@admin.ru", "2016-09-16T07:00:00Z", "2016-09-20T07:00:00Z", "520", "Scrum meeting"});

{{{attentions}}}

DeleteItem

Deleting an item

Syntax

device.DeleteItem({Callback, ID, ChangeKey});

input value description
Callback "DeletingInfo" type: function
function where an answer from the server comes
ID 12 type: number
item ID
ChangeKey 905 type: Number
item key
output

-


Sample

function DeletingFeedback(result)
{
  IR.Log("Deleted: " + result.Deleted);
  IR.Log("Error: " + result.Error);
}
 
device.DeleteItem({DeletingFeedback(result), 12, 502});

{{{attentions}}}