Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,582 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
// environment
// OAUTH_REDIRECT_URI=http://localhost:3000/delegated/callback
// OAUTH_SCOPES = 'https://graph.microsoft.com/OnlineMeetings.Read.All,https://graph.microsoft.com/OnlineMeetings.ReadWrite.All'
// /signin
const authUrl = `https://login.microsoftonline.com/common/adminconsent?client_id=${process.env.OAUTH_CLIENT_ID}&state=${MYAPP_STATE}&redirect_uri=${process.env.OAUTH_REDIRECT_URI}`;
https: res.redirect(authUrl);
// response
admin_consent: True
tenant: {OWN_TENANT_ID_HERE}
state: MYAPP_STATE
const client = graph.getGraphClientForApp(req.app.locals.msalClient);
const notificationHost = process.env.NGROK_PROXY;
const JoinWebUrl =
'https://teams.microsoft.com/l/meetup-join/19%3ameeting_YzI1YjI0ZWMtNTU4ZS00YWI1LTgwZGEtOWE1YTU3MzIyYTZl%40thread.v2/0?context=%7b%22Tid%22%3a%22c0890c45-a72b-48ff-8447-29d2135997f9%22%2c%22Oid%22%3a%22e0b27185-212f-40d1-8e41-87ac4cbdefd8%22%7d';
const resource = `/communications/onlineMeetings/?$filter=JoinWebUrl eq '${JoinWebUrl}'`;
const subscription = await client
.api('/subscriptions')
.version('beta')
.create({
changeType: 'updated',
notificationUrl: `${notificationHost}/listen`,
resource,
clientState: process.env.SUBSCRIPTION_CLIENT_STATE,
includeResourceData: false,
expirationDateTime: new Date(Date.now() + 3600).toISOString(),
});
{
statusCode: 500,
code: 'UnknownError',
requestId: 'c170df43-786d-4059-99d4-59f4c1a65b5d',
date: 2022-09-05T21:51:23.000Z,
body: '{"code":"UnknownError","message":"DocumentDb subscription creation failed","innerError":{"date":"2022-09-06T06:51:23","request-id":"c170df43-786d-4059-99d4-59f4c1a65b5d","client-request-id":"44ea6d8f-8ff6-e1fb-af8b-417d88c1286c"}}'
}
I can't find the next action.
Do you have any ideas?