我有一个管理员帐户来创建Graph API在线会议。假设我想为其他人创建在线会议作为组织者,该怎么办?创建会议时,我看不到任何参数。
答案 0 :(得分:0)
答案 1 :(得分:0)
尝试一下:
var client = new RestClient("https://graph.microsoft.com/v1.0/me/onlineMeetings");
var request = new RestRequest(Method.POST);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer "+token);
request.AddHeader("accept-language", "en");
request.AddHeader("accept", "application/json");
request.AddParameter("application/json", "{\"startDateTime\": \"2020-09-
28T19:30:34.2444915-07:00\",\n\"endDateTime\": \"2020-09-
28T20:00:34.2464912-07:00\",\"subject\": \"User Token Meeting\"}",
ParameterType.RequestBody);
var response = client.Execute(request);
要检索令牌:
var client = new RestClient("https://login.microsoftonline.com/{tenant-
Id}/oauth2/v2.0/token");
var request = new RestRequest(Method.POST);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("grant_type", "password");
request.AddParameter("application/x-www-form-urlencoded",
"grant_type=password&client_id={client-Id}&client_secret={client-
secret}&scope={scopeurl}&userName={username}&password={password}",
ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var json = response`.`Content;
var JSONObject = JObject.Parse(json);
var token = (string)JSONObject["access_token"];