create graph api client to handle requests

This commit is contained in:
Bilal
2020-08-12 16:36:47 +02:00
parent 3352217a03
commit f25a72004e
8 changed files with 123 additions and 4 deletions

View File

@@ -0,0 +1,17 @@
class MicrosoftTeamsMeetingsController < ApplicationController
require 'microsoft_graph'
def show
authorize broadcast = Broadcast.find(params[:broadcast_id])
graph_api = MicrosoftGraph.new(current_user, ENV['AZURE_CLIENT_ID'], ENV['AZURE_CLIENT_SECRET'], ENV['AZURE_SCOPES'])
meeting_start = DateTime.now
meeting_end = DateTime.now + 1.hour
subject = "Broadcast Meeting"
r = graph_api.create_teams_meeting(meeting_start, meeting_end, subject)
render plain: r
end
end