Giter Site home page Giter Site logo

exchanger's Introduction

Exchanger

Continuous Integration status

Ruby library for accessing Microsoft Exchange using Exchange Web Services. This library tries to make creating and updating items as easy as possible. It will keep track of changed properties and will update only them.

Supported operations

  • FindItem, GetItem, CreateItem, UpdateItem, DeleteItem
  • FindFolder, GetFolder
  • ResolveNames, ExpandDL
  • GetUserAvailability

Installing

gem install exchanger

Configuration

Exchanger.configure do |config|
  config.endpoint = "https://domain.com/EWS/Exchanger.asmx"
  config.username = "username"
  config.password = "password"
end

or configure from YAML

Exchanger::Config.instance.from_hash(YAML.load_file("#{Rails.root}/config/exchanger.yml")[Rails.env])

Examples

Creating and updating contacts

folder = Exchanger::Folder.find(:contacts)
contact = folder.new_contact
contact.given_name = "Edgars"
contact.surname = "Beigarts"
contact.email_addresses = [ Exchanger::EmailAddress.new(:key => "EmailAddress1", :text => "[email protected]") ]
contact.phone_numbers = [ Exchanger::PhoneNumber.new(:key => "MobilePhone", :text => "+371 80000000") ]
contact.save # CreateItem operation
contact.company_name = "Example Inc."
contact.save # UpdateItem operation
contact.destroy # DeleteItem operation

Searching in Global Address Book

mailboxes = Exchanger::Mailbox.search("John")

Running specs with Exchange Server

The easiest way is to sign up for a Microsoft Office 365 free trial.

  1. Create a random calendar entry in July 2016
  2. Create a distribution list named 'Test'
  3. Create spec/config.yml with your Exchange credentials
  4. Create spec/fixtures/get_user_availability.yml with your Exchange email address
  5. Clear the recorded VCR cassettes by removing spec/cassettes
  6. Run the specs rake spec

It looks like Office 365 trial has some rate limits, so you may have to record the VCR cassettes for each spec separately.

Exchanger::Operation::ResponseError:
  An internal server error occurred. Try again later.

Alternatives

exchanger's People

Contributors

duksis avatar ebeigarts avatar nikitachernov avatar pcboy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.