ebeigarts / exchanger

Ruby client for Exchange Web Services
MIT License
57 stars 36 forks source link

Cannot get folder #21

Closed Herz3h closed 7 years ago

Herz3h commented 7 years ago

Hello when i try to execute this code :

I have put this code

require 'exchanger'

Exchanger.configure do |config|
  config.endpoint = "https://domain.com/EWS/Exchanger.asmx"
  config.username = "username"
  config.password = "password"
  config.debug = true # show Exchange request/response info
end

in exchanger.rb in initializers folders and then when i try this code in my controller :

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 => "me@example.com") ]
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

It tells me that folder is nil...I've already configured the endpoint and login/password. I've also tried with the office 365 ews endpoint : https://outlook.office365.com/EWS/Exchange.asmx

Herz3h commented 7 years ago

Never mind again... was just a mispelling in my username lol