msgraph-sdk-ruby
msgraph-sdk-ruby copied to clipboard
Documentation
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.
We hear you and appreciate the feedback about docs.
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 thanks for your time. i have used the REST API for now
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.
@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
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.
Thanks for reporting this issue. That version of the SDK has been deprecated a number of years ago. We're now starting the work on a new generation of this SDK and you can learn all about it on the updated readme page.