msgraph-sdk-ruby icon indicating copy to clipboard operation
msgraph-sdk-ruby copied to clipboard

Documentation

Open sushant12 opened this issue 6 years ago • 6 comments

It would be nice to have a documentiaon for this gem. I am having some trouble finding out how to create an event using this gem.

sushant12 avatar Sep 13 '17 11:09 sushant12

We hear you and appreciate the feedback about docs.

dpim avatar Sep 13 '17 15:09 dpim

def self.create_event(user, dateTime, endTime, time)   
  if user.outlook_token.expired?
    user.outlook_token.refresh!(user)
  end
  
  callback = Proc.new do |r| 
    r.headers['Authorization'] = "Bearer #{access_token}"
    r.headers['Content-type'] = 'application/json'
    r.headers['X-AnchorMailbox'] = user.email
  end

  graph = MicrosoftGraph.new(base_url: 'https://graph.microsoft.com/v1.0/',
                            cached_metadata_file: File.join(MicrosoftGraph::CACHED_METADATA_DIRECTORY, 'metadata_v1.0.xml'),
                            &callback)

  @create = graph.me.events.create(subject: "subject", 
    body: {content: "content"},
    start: {dateTime: dateTime, timeZone: "America/New_York"}, end: {dateTime: endTime,  timeZone: "America/New_York"}, 
    organizer: {emailAddress: {name: "name", address: "email"}},
    responseRequested: true, responseStatus: {"@odata.type" => "microsoft.graph.responseStatus"})

Make sure your Date Time is in the right format, this gave me some headaches to figure out as well. A lot of trial and error but this works for me.

loganh0522 avatar Oct 01 '17 14:10 loganh0522

@loganh0522 thanks for your time. i have used the REST API for now

sushant12 avatar Oct 03 '17 03:10 sushant12

I agree with the OP. This gem is great, but the absence of documentation is really limits its usefulness. For instance, I'm trying to get access to instances of recurring events or a calendar_view that contains all instances of recurring events, but this is not possible without any documentation. Some advice on how the REST API translates to this gem would be helpful too.

jeroenkeppens avatar Nov 06 '17 01:11 jeroenkeppens

@dpim do u know when will you guys start working on the documentation? Like @jeroenkeppens said, this gem is great but the lack of doc limits its usefulness

sushant12 avatar Nov 15 '17 09:11 sushant12

I agree that the library is quite difficult to use without documentation. Unfortunately, this work is not on the horizon at the moment. If you are having significant trouble enabling your scenario through the SDK, the best I can recommend is using REST directly.

caitlinrussell avatar Nov 15 '17 18:11 caitlinrussell